snappool数据库连接池的应用

时间:2012-04-24 13:08:47
【文件属性】:

文件名称:snappool数据库连接池的应用

文件大小:31KB

文件格式:JAR

更新时间:2012-04-24 13:08:47

snappool数据库连接池

这个连接池到很好用. 但是,把Connection给集成了,无法管理,这样就限制了批处理的应用. static{ URL url = DBConnectionPoolSnap.class.getResource(JDBC_CONNECTION_POOL_CONFIG_FILE); String path = url.getPath(); File file = new File(path); ConnectionManager.init(file.getPath()); } ...... pool = ConnectionManager.getConnectionPool("Oracle"); 释放连接的方法是 pool.close(); 连接池文件配置如下: logger { logDir =logs/connPool debug = false } DatabaseProfile { Oracle { driverClass = oracle.jdbc.driver.OracleDriver dbUrl = jdbc:oracle:thin:@192.168.0.108:1521:oracle dbUser = tester dbPass = tester connectionPoolSize= 5 statementPoolSize= 100 idleTimeout= 120 shrinkInterval= 80 } MySql { driverClass = org.gjt.mm.mysql.Driver dbUrl = jdbc:mysql://127.0.0.1:3306/xinbinlog?useUnicode=true&characterEncoding=gbk dbUser =root dbPass =113200 connectionPoolSize= 25 statementPoolSize= 50 idleTimeout= 30 shrinkInterval= 80 } SQLServer { driverClass = com.inet.tds.TdsDriver dbUrl =jdbc:inetdae:127.0.0.1:1433?database=KQ&charset=gbk #jdbc:microsoft:sqlserver://192.168.3.205:1433;DatabaseName=test dbUser =sa dbPass =10317 connectionPoolSize=50 statementPoolSize= 50 idleTimeout= 300 shrinkInterval= 120 } ODBC{ driverClass = sun.jdbc.odbc.JdbcOdbcDriver dbUrl =jdbc:odbc:kq dbUser = xc dbPass = 10317 connectionPoolSize=25 statementPoolSize= 50 idleTimeout= 30 shrinkInterval= 120 } }


网友评论

  • 还可以,但是下在后才发现我有一个工程里有了
  • 对于小型项目这个数据源配置还不错