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.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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.