I’m trying to config datasource in Spring 2.5.6.
My database is oracle 11g and jdbc driver is ojdbc6.
The following is my configuration:
<bean id="databaseConnectionPool" class="oracle.jdbc.pool.OracleDataSource" destroy-method="close">
<property name="connectionCachingEnabled" value="true"/>
<property name="URL"><value>${jdbc.dburl}</value></property>
<property name="connectionCacheName" value="PSSMST"/>
<property name="user"><value>${jdbc.dbusername}</value></property>
<property name="password"><value>${jdbc.dbpassword}</value></property>
<property name="maxStatements" value="75"/>
<property name="connectionCacheProperties">
<props merge="default">
<prop key="MinLimit">20</prop>
<prop key="MaxLimit">150</prop>
<prop key="InitialLimit">20</prop>
</props>
</property>
</bean>
But when the Tomcat server starts up, I get this message:
Invalid property ‘connectionCachingEnabled’ of bean class
[oracle.jdbc.pool.OracleDataSource]: Bean property
‘connectionCachingEnabled’ is not writable or has an invalid setter
method. Does the parameter type of the setter match the return type of
the getter?
That really makes me upset. I checked the OracleDataSource class, of course, the setConnectionCachingEnabled method exists.
Does anybody know how to resolve this?
The probable reason is that you are using an older version of ODBC than intended. Please check lib folder of your application and also check lib folder of Tomcat.