当前位置: 代码迷 >> J2EE >> oracle10g和hibernate有关问题
  详细解决方案

oracle10g和hibernate有关问题

热度:50   发布时间:2016-04-22 01:22:48.0
oracle10g和hibernate问题
开始配置如下
<property name="myeclipse.connection.profile">oracle 9</property>
<property name="connection.url">jdbc:oracle:thin:@localhost:1521:tourINSU</property>
<property name="connection.username">touradmin</property>
<property name="connection.password">touradmin</property>
<property name="connection.driver_class">
oracle.jdbc.driver.OracleDriver
</property>
<property name="dialect">
org.hibernate.dialect.Oracle9Dialect
</property>
<property name="show_sql">true</property>

项目开始运行稳定,可是过段时间之后,就会出现以下异常
03-12 15:59:14.562 ERROR [JDBCExceptionReporter.java:78] Io 异常: Connection res
et by peer: socket write error
select error: could not execute query
03-12 15:59:14.562 ERROR [JDBCTransaction.java:168] JDBC rollback failed


我然后把驱动换成10g的,
配置如下


<property name="connection.url">jdbc:oracle:thin:@localhost:1521:inshyx</property>
<property name="connection.username">hyxadmin</property>
<property name="connection.password">admin</property>
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<!-- JDBC connection pool (use the built-in) -->  
  <property name="connection.pool_size">1</property>  
  <!-- SQL dialect -->  
  <property name="dialect">org.hibernate.dialect.Oracle10gDialect</property>  
  <!-- Enable Hibernate's automatic session context management -->  
  <property name="current_session_context_class">thread</property>  
  <!-- Disable the second-level cache -->  
  <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>  
  <!-- Echo all executed SQL to stdout -->  
  <property name="show_sql">true</property>  
但是局域网其他机器上运行项目访问我的数据库,访问不了,
请问各位大虾,这个问题该怎么解决





------解决方案--------------------
本地可以 其他不行 看看你防火墙之类的
  相关解决方案