开发者

How to specify schema for SQL Server in JDBC Spring configuration

开发者 https://www.devze.com 2023-02-21 21:40 出处:网络
We are using the org.apache.commons.dbcp.BasicDataSource as parent class for our datasources in Spring.

We are using the org.apache.commons.dbcp.BasicDataSource as parent class for our datasources in Spring.

Is it possible to s开发者_Python百科pecify which schema to use in either the "url" or in another property in the DBCP datasource?


I don't think it's possible to specify the schema since this is a function of the user, not the JDBC session. You should probably create a user with their default schema set to each schema you want to use, and then specify the user in the dbcp configuration.


Just give schema=SCHEMANAME

For example jdbc:sqlserver://ipaddress:port;database=DBName;schema=SCHEMANAME;selectMethod=cursor;sendStringParametersAsUnicode=false;IntegratedSecurity=true

0

精彩评论

暂无评论...
验证码 换一张
取 消