Tomcat JDBC connection pool for different schema

大憨熊 提交于 2019-12-12 06:06:39

问题


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.



来源:https://stackoverflow.com/questions/34436686/tomcat-jdbc-connection-pool-for-different-schema

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!