문제

I am calling SqlSession.openSession(Connection) in MyBatis. The Connection is to a MySQL database and does not have a schema specified in the URL (e.g. jdbc:mysql://localhost). I'd like to set a "default schema" in MyBatis that will be used to execute mapped queries against, but I can't find out how. Does anyone know?

도움이 되었습니까?

해결책

If your mapped queries generated with MyBatis Generator, before generation you could set schema and it prepends its name to the queries. Without writing schema name, MyBatis couldnt set default schema.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top