I am new to SpringFramework. I tried to use c3p0 connection pool with my code. I can use the XmlBeanFactory to get the ComboPooledDataSource. However, I got TypeMismatchException when I tried to get productManager instance.
Failed to convert property value of type [java.lang.String] to required type [javax.sql.DataSource] for property 'dataSource']
Any idea?
Thanks.
java9394
Code:<beans> <bean id="productDS" class="com.mchange.v2.c3p0.ComboPooledDataSource"> <property name="driverClass"><value>oracle.jdbc.OracleDriver</value></property> <property name="jdbcUrl"><value>jdbc:oracle:thin:correctURLforDB</value></property> <property name="minPoolSize"><value>1</value></property> <property name="acquireIncrement"><value>1</value></property> <property name="maxPoolSize"><value>10</value></property> </bean> <bean id="productManager" class="com.mycom.ProductManagerDaoJdbc"> <property name="dataSource"><idref local="productDS"/></property> </bean> </beans>


Reply With Quote
