ssh 整合 中怎么使用 c3p0 链接池 经测试已成功 不受 hibernate的8小时限制
实现方式很简单,只操作 applicationContext文件就可以了 再加个c3p0的开发包 自己下:
applicationContext.xml中配置:
1: <!-- 添加 dataSource-->
<bean id="dataSource"
/>
</property>
<property name="mappingResources">
<list>
<!--这里面放你hibernate 中的 pojo xml 对象-->
<value>com/pojos/TbLimits.hbm.xml</value>
<value>com/pojos/TbHandlerLimits.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.generate_statistics">true</prop>
<prop key="hibernate.connection.release_mode">auto</prop>
<prop key="hibernate.autoReconnect">true</prop>
</props>
</property>
</bean>
<!--修改系统时间进行测试试试-->
下面把application.xml 中的一些配置方法罗列下,以及一些事物
init.properties文件配置内容
driverName=com.mysql.jdbc.Driver#driverName=com.p6spy.engine.spy.P6SpyDriverdataSource.url=jdbc:mysql://ip地址/数据库名称?useUnicode=true&characterEncoding=UTF-8dataSource.username=rootdataSource.password=roothibernate.show_sql =true