我最近做了一个基于web开发的java项目,其中用到了ibatis技术。
我需要用java的一个方法调用ibatis的配置文件,然后往oracle数据库中写入一条记录,其中有两个字段是Clob的(大文本),就为这两个字段的读写折腾了好久,始终能正确运行。
公司要求我做项目的可以使用oracle10g的jdbc driver(ojdbc14.jar),也可以换成oracle9i的jdbcdriver(classes12.jar),
我目前的状况是换成10g的驱动后,就可以正确对大文本字段进行读写;
但是换成9i的驱动后,读取的时候是个null,而且写入的时候抛出异常,会报的错误为:
java.sql.SQLException: Io 异常: Connection reset by peer: socket write error
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)
at oracle.jdbc.driver.OracleConnection.rollback(OracleConnection.java:13
80)
at com.ibatis.common.jdbc.SimpleDataSource.pushConnection(SimpleDataSour
ce.java:527)
at com.ibatis.common.jdbc.SimpleDataSource.access$100(SimpleDataSource.j
ava:52)
at com.ibatis.common.jdbc.SimpleDataSource$SimplePooledConnection.invoke
(SimpleDataSource.java:954)
at $Proxy0.close(Unknown Source)
at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.close(JdbcT
ransaction.java:81)
at com.ibatis.sqlmap.engine.transaction.TransactionManager.end(Transacti
onManager.java:110)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.endTransaction(S
qlMapExecutorDelegate.java:780)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.endTransaction(SqlMap
SessionImpl.java:170)
at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.endTransaction(SqlMapC
lientImpl.java:149)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.autoEndTransacti
on(SqlMapExecutorDelegate.java:880)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert(SqlMapExe
cutorDelegate.java:457)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.insert(SqlMapSessionI
mpl.java:82)
at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.insert(SqlMapClientImp
l.java:60)
at com.lhcc.logging.LogSystemOpe.writeLog(LogSystemOpe.java:153)
at com.cltt.datainput.InputOperator.writeLog(InputOperator.java:2703)
at com.cltt.datainput.InputOperator.updateData(InputOperator.java:866)
at com.cltt.datainput.InputAction.execute(InputAction.java:48)
at org.apache.struts.action.RequestProcessor.processActionPerform(Reques