项目在tomcat下运行一切正常,当时当发布到Tongweb下面对数据库进行操作时出现无法获取连接的错误????
三个连接池的配置<!--数据源定义,使用c3p0连接池--><beanid="dataSource"class="com.mchange.v2.c3p0.ComboPoo...
三个连接池的配置
<!-- 数据源定义,使用c3p0 连接池 -->
<bean id="dataSource"
class="com.mchange.v2.c3p0.ComboPooledDataSource"><!-- destroy-method="close" -->
<property name="driverClass" value="${jdbc.driverClassName}" />
<property name="jdbcUrl" value="${jdbc.url}" />
<property name="user" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
<property name="initialPoolSize" value="1" />
<property name="minPoolSize" value="5" />
<property name="maxPoolSize" value="20" />
<property name="acquireIncrement" value="5" />
<!-- h.y add begin-->
<property name="autoCommitOnClose" value="true" />
<property name="maxIdleTime" value="${jdbc.maxIdleTime}" />
<property name="maxStatements" value="0" />
<property name="maxStatementsPerConnection" value="100" />
<!-- h.y add end-->
</bean>
<!-- postfix连接池 -->
<bean id="postfixDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="driverClass">
<value>${postfix.jdbc.driverClassName}</value>
</property>
<property name="jdbcUrl">
<value>${postfix.jdbc.url}</value>
</property>
<property name="maxIdleTime"><value>25200</value></property>
<property name="initialPoolSize" value="5" />
<property name="properties">
<props>
<prop key="c3p0.acquire_increment">2</prop>
<prop key="c3p0.idle_test_period">200</prop>
<prop key="c3p0.timeout">1000</prop>
<prop key="c3p0.max_size">50</prop>
<prop key="hibernate.c3p0.max_statements">100</prop>
<prop key="hibernate.c3p0.min_size">5</prop>
<prop key="user">${postfix.jdbc.user}</prop>
<prop key="password">${postfix.jdbc.password}</prop>
</props>
</property>
</bean>
<!-- 数据源定义,使用c3p0 连接池 -->
<bean id="dataSource3"
class="com.mchange.v2.c3p0.ComboPooledDataSource"><!-- destroy-method="close" -->
<property name="driverClass" value="${jdbc.driverClassName3}" />
<property name="jdbcUrl" value="${jdbc.url3}" />
<property name="user" value="${jdbc.username3}" />
<property name="password" value="${jdbc.password3}" />
<property name="initialPoolSize" value="10" />
<property name="minPoolSize" value="10" />
<property name="maxPoolSize" value="50" />
<property name="acquireIncrement" value="5" />
<property name="autoCommitOnClose" value="true" />
<property name="maxIdleTime" value="${jdbc.maxIdleTime}" />
<property name="maxStatements" value="0" />
<property name="maxStatementsPerConnection" value="100" />
</bean> 展开
<!-- 数据源定义,使用c3p0 连接池 -->
<bean id="dataSource"
class="com.mchange.v2.c3p0.ComboPooledDataSource"><!-- destroy-method="close" -->
<property name="driverClass" value="${jdbc.driverClassName}" />
<property name="jdbcUrl" value="${jdbc.url}" />
<property name="user" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
<property name="initialPoolSize" value="1" />
<property name="minPoolSize" value="5" />
<property name="maxPoolSize" value="20" />
<property name="acquireIncrement" value="5" />
<!-- h.y add begin-->
<property name="autoCommitOnClose" value="true" />
<property name="maxIdleTime" value="${jdbc.maxIdleTime}" />
<property name="maxStatements" value="0" />
<property name="maxStatementsPerConnection" value="100" />
<!-- h.y add end-->
</bean>
<!-- postfix连接池 -->
<bean id="postfixDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="driverClass">
<value>${postfix.jdbc.driverClassName}</value>
</property>
<property name="jdbcUrl">
<value>${postfix.jdbc.url}</value>
</property>
<property name="maxIdleTime"><value>25200</value></property>
<property name="initialPoolSize" value="5" />
<property name="properties">
<props>
<prop key="c3p0.acquire_increment">2</prop>
<prop key="c3p0.idle_test_period">200</prop>
<prop key="c3p0.timeout">1000</prop>
<prop key="c3p0.max_size">50</prop>
<prop key="hibernate.c3p0.max_statements">100</prop>
<prop key="hibernate.c3p0.min_size">5</prop>
<prop key="user">${postfix.jdbc.user}</prop>
<prop key="password">${postfix.jdbc.password}</prop>
</props>
</property>
</bean>
<!-- 数据源定义,使用c3p0 连接池 -->
<bean id="dataSource3"
class="com.mchange.v2.c3p0.ComboPooledDataSource"><!-- destroy-method="close" -->
<property name="driverClass" value="${jdbc.driverClassName3}" />
<property name="jdbcUrl" value="${jdbc.url3}" />
<property name="user" value="${jdbc.username3}" />
<property name="password" value="${jdbc.password3}" />
<property name="initialPoolSize" value="10" />
<property name="minPoolSize" value="10" />
<property name="maxPoolSize" value="50" />
<property name="acquireIncrement" value="5" />
<property name="autoCommitOnClose" value="true" />
<property name="maxIdleTime" value="${jdbc.maxIdleTime}" />
<property name="maxStatements" value="0" />
<property name="maxStatementsPerConnection" value="100" />
</bean> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询