We are using the org.apache.commons.dbcp.BasicDataSource as parent class for our datasources in Spring.
Is it possible to specify which schema to use in either the "url" or in another property in the DBCP datasource?
We are using the org.apache.commons.dbcp.BasicDataSource as parent class for our datasources in Spring.
Is it possible to specify 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.
I believe that what you want is not really an schema, but a database. If this works for you, you can use the option ....;databaseName= at the jdbc url.
Just give schema=SCHEMANAME
For example
jdbc:sqlserver://ipaddress:port;database=DBName;schema=SCHEMANAME;selectMethod=cursor;sendStringParametersAsUnicode=false;IntegratedSecurity=true
© 2022 - 2024 — McMap. All rights reserved.