apache-commons-dbcp

Method org.postgresql.jdbc4.Jdbc4Connection.isValid(int) is not yet implemented

末鹿安然 提交于 2019-11-26 23:12:38
问题 I am trying to configure dbcp2 with postgres 9.1 When I run my app, it throws exception: Exception in thread "main" org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Cannot create PoolableConnectionFactory (Method org.postgresql.jdbc4.Jdbc4Connection.isValid(int) is not yet implemented.) at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80) at org.springframework.jdbc

Java JDBC connection pool library choice in 2011/2012?

拟墨画扇 提交于 2019-11-26 21:25:22
Which JDBC connection pool library should I use for a new application project (not web application)? Apache DBCP has enough unresolved issues which are pushed until 2.0 I think. C3P0 development seems to be stopped. And both of them looks relatively slow . Proxool is dead. DBPool has almost no community (at least I've found no public one - no forums, no mailing lists...) Apache Tomcat Pool looks to be unusable without Tomcat I've found SQL Datasources article at Oracle website, but it seems, that it can be applied only to applets running in containers like servlets and web services. Should I

Spring JDBC connection pool best practices

允我心安 提交于 2019-11-26 17:36:00
问题 I have a basic Spring JDBC application with a pretty basic configuration: <bean id="myDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="oracle.jdbc.OracleDriver"/> <property name="url" value="jdbc:oracle:thin:@1.1.1.1:1521:XXX"/> <property name="username" value="username"/> <property name="password" value="password"/> </bean> <bean id="dbThing" class="com.DbThing"> <property name="dataSource" ref="myDataSource"/> </bean> I

DBCP - validationQuery for different Databases

时光总嘲笑我的痴心妄想 提交于 2019-11-26 16:59:55
I use DBCP pool and I want use testOnBorrow and testOnReturn to test if connection is still valid. Unfortunately I have to set property validationQuery to make it work. Question: What value should be in validationQuery? I know, that: validationQuery must be an SQL SELECT statement, that returns at least one row. Problem is that we use various databases (DB2, Oracle, hsqldb). bugs_ There is not only one validationQuery for all databases. On each database you have to use different validationQuery. After few hours of googling and testing I have collected this table: Database validationQuery notes

tomcat-dbcp vs commons-dbcp

旧街凉风 提交于 2019-11-26 15:14:04
问题 It seems there is a lot of confusion between these two connection pooling libraries. What I want to know is which one is better (if at all)? Here are some points which I would like to put up... Could someone please verify? Tomcat DBCP: uses the default tomcat-dbcp.jar which will be present in your tomcat/lib directory. You do not need commons-dbcp.jar or commons-pool.jar libraries in your web-inf/lib. The DB driver should be placed in tomcat/lib. Tomcat DBCP datasource class is org.apache

Java JDBC connection pool library choice in 2011/2012?

落爺英雄遲暮 提交于 2019-11-26 07:56:00
问题 Which JDBC connection pool library should I use for a new application project (not web application)? Apache DBCP has enough unresolved issues which are pushed until 2.0 I think. C3P0 development seems to be stopped. And both of them looks relatively slow. Proxool is dead. DBPool has almost no community (at least I\'ve found no public one - no forums, no mailing lists...) Apache Tomcat Pool looks to be unusable without Tomcat I\'ve found SQL Datasources article at Oracle website, but it seems,

Connection pooling options with JDBC: DBCP vs C3P0

 ̄綄美尐妖づ 提交于 2019-11-25 22:45:30
问题 What is the best connection pooling library available for Java/JDBC? I\'m considering the 2 main candidates (free / open-source): Apache DBCP - http://commons.apache.org/dbcp/ C3P0 - http://sourceforge.net/projects/c3p0 I\'ve read a lot about them in blogs and other forums but could not reach a decision. Are there any relevant alternatives to these two? 回答1: DBCP is out of date and not production grade. Some time back we conducted an in-house analysis of the two, creating a test fixture which