论坛首页 入门技术论坛

DB2 JDBC driver's bug?, Connection is closed

浏览 3552 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2007-11-28  
I use code(DB2 JDBC 4 type driver):
Connection conn = ...;
Statement stat = conn.prepareCall(query);
state.execute();
...
resultSet.getMetaData();


and I get exception like:
com.ibm.db2.jcc.b.SqlException: [ibm][db2][jcc][10335][10366] Invalid
operation: Connection is closed.
at com.ibm.db2.jcc.b.bb.Nb(bb.java:3356)
at com.ibm.db2.jcc.b.bb.a(bb.java:1589)
at com.ibm.db2.jcc.b.bb.prepareStatement(bb.java:490) 


It's very strange that the same code works fine on MySql, Oracle, Sybase etc, at last it works, but I must create Statement like:
 statement = conn.prepareCall(query,
ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);


So it's a DB2 JDBC driver implementation bug?
论坛首页 入门技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics