Reputation: 1325
How do we configure 2 different schema for the same database using tomcat jdbc. Do we need to create two different configuration of tomcat jdbc pool connection for different schema or is it possible to configure a single jdbc connection pool then use this connection pool to connect to two different schema.
Upvotes: 0
Views: 1267
Reputation: 13858
That depends
If your two schema share the same credentials and are hosted on the same db server, you could probably use one pool. But then you'd have to include schema in all your queries like:
SELECT * FROM mysql.users
If on the other hand you connect with different users or plan to move one of the schema to another server, you by all means want different pools for connections to the different databases.
The save way would be to have multiple pools and use them according to the data you need to access.
Upvotes: 6