I've found out you can use c3p0 library
(http://www.mchange.com/projects/c3p0) so you can rely on connection pooling
are not forced to write your own connection testing in the route.
here is an example of the jdbc datasource bean:
<bean id="mysqlPooled"
class="com.mchange.v2.c3p0.ComboPooledDataSource" >
<property name="driverClass" value="com.mysql.jdbc.Driver" />
<property name="jdbcUrl"
value="jdbc:mysql://localhost:3306/test" />
<property name="user" value="user" />
<property name="password" value="pass" />
<property name="minPoolSize" value="1" />
<property name="maxPoolSize" value="5" />
<property name="maxIdleTime" value="60" />
<property name="maxStatements" value="0" />
<property name="preferredTestQuery" value="SELECT 1;" />
<property name="idleConnectionTestPeriod" value="30" />
</bean>
just include c3p0 in your dependencies
<dependency>
<groupId>c3p0</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.1.1</version>
</dependency>
--
View this message in context:
http://camel.465427.n5.nabble.com/camel-sql-connection-test-required-tp5736549p5736555.html
Sent from the Camel - Users mailing list archive at Nabble.com.