首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

不会招致数据库自动断开的连接方法

2012-10-18 
不会导致数据库自动断开的连接方法hibernate连接Oracle 数据库 一段时间后连接不上了,报异常,就换成以下连

不会导致数据库自动断开的连接方法
hibernate连接Oracle 数据库 一段时间后连接不上了,报异常,就换成以下连接方式,当然要导入C3p0的包

<!-- 数据库连接 -->
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.password">******</property>
<property name="hibernate.connection.SetBigStringTryClob">true</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@**.**.**.**:1521:orcl2</property>
<property name="hibernate.connection.username">***</property>
<property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.connection.pool_size">10</property>
<property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
<property name="hibernate.c3p0.min_size">1</property>
<property name="hibernate.c3p0.max_size">5</property>
<property name="hibernate.c3p0.timeout">2500</property>
<property name="hibernate.c3p0.max_statements">50</property>

热点排行