camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marco Crivellaro <marco.cr...@gmail.com>
Subject Re: camel-sql, connection test required?
Date Wed, 31 Jul 2013 10:45:54 GMT
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.

Mime
View raw message