如何使用mchange.v2.c3p0.ComboPooledDataSource和maxConnectionAge

时间:2018-01-17 15:20:08

标签: java spring-mvc

我试图在我的bean中使用maxConnectionAge属性:

<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" 
   destroy-method="close">
   <property name="maxConnectionAge" value="7200" />

我的pom.xml:

    <dependency>
        <groupId>c3p0</groupId>
        <artifactId>c3p0</artifactId>
        <version>0.9.1.2</version>
    </dependency>

问题是,即使我尝试创建,也不能使用setConneter和getter来获取maxConnectionAge的属性:

  ComboPooledDataSource cpds = new ComboPooledDataSource();
  cpds.setMaxConnectionAge() <- its not recognized by the intellisense

我如何使用maxConnectionAge?

错误: enter image description here

0 个答案:

没有答案