有没有个数据源池的概念 大概客户数据库2000+ 各个连接配置都不一样
34 回复
不要发这种标题!
来自炫酷的 NutzCN
切换??
来自炫酷的 NutzCN
没懂
来自炫酷的 NutzCN
如果是独立数据库,每个租户的数据保存在物理上独立的数据库实例。JDBC 连接将指向具体的每个数据库,一个租户对应一个数据库实例。在 Hibernate 中,这种模式可以通过实现 MultiTenantConnectionProvider 接口或继承 AbstractMultiTenantConnectionProvider 类等方式来实现。
看了文章说这样处理 请问nutz要怎么做处理
Map<String,DataSource> dss = new HashMap();
protected DataSource selectDataSource(Transaction t, DataSource master, ConnCallback callback) {
HttpServletRequest req = Mvcs.getReq();
if (req == null) return master;
String key = (String)req.getAttrxxx("xxxxxx')
if (key == null) return master;
DataSource ds = dss.get(key);
if (ds == null) {
ds = 新建连接池();
dss.put(key, ds);
}
return ds;
}
大佬 这个是什么
警告: ConnectionID:30 ClientConnectionId: 38e38a3e-ccc6-42c0-9430-19ad67524c44 Server major version:8 is not supported by this driver.
2017-12-27 22:24:05 [com.alibaba.druid.pool.DruidDataSource]-[ERROR] create connection error, url: jdbc:sqlserver://fjminshop.tpddns.cn;DatabaseName=Build_masterCS, errorCode 0, state 08S01
com.microsoft.sqlserver.jdbc.SQLServerException: 该驱动程序不支持 SQL Server 8 版。 ClientConnectionId:38e38a3e-ccc6-42c0-9430-19ad67524c44
at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:1667)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:1654)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.Prelogin(SQLServerConnection.java:1556)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1319)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:991)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:827)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1012)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1421)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1477)
at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1998)
十二月 27, 2017 10:24:05 下午 com.microsoft.sqlserver.jdbc.SQLServerConnection Prelogin
警告: ConnectionID:31 ClientConnectionId: 30a24b67-9c06-472a-a248-2b92a6745929 Server major version:8 is not supported by this driver.
2017-12-27 22:24:05 [com.alibaba.druid.pool.DruidDataSource]-[ERROR] create connection error, url: jdbc:sqlserver://fjminshop.tpddns.cn;DatabaseName=Build_masterCS, errorCode 0, state 08S01
com.microsoft.sqlserver.jdbc.SQLServerException: 该驱动程序不支持 SQL Server 8 版。 ClientConnectionId:30a24b67-9c06-472a-a248-2b92a6745929
at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:1667)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:1654)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.Prelogin(SQLServerConnection.java:1556)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1319)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:991)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:827)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1012)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1421)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1477)
at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1998)
添加回复
请先登陆