2014年5月26日星期一

java can not generate a result set is empty , scrollable result sets generated problems

public ResultSet executeQuery () throws SQLException {
String sql = "select YHID from YH_INFO where YHID =?";
prepStmt = conn.prepareStatement (sql, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
prepStmt.setString (1, "zz");
ResultSet rs = prepStmt.executeQuery ();
prepStmt.close ();
return rs;
}
resultset should have results may resultSet is empty


connected oracle 10g, the driver is class12, ojdbc14. scored by the connection pool
------ Solution ------------------- -------------------------
prepStmt.close (); removed.
------ For reference only -------------------------------------- -
break point with it, or the sql statement out, ran into plsql in it, look at the results .
see the value of sql statement not check out , or call the java code problem.

没有评论:

发表评论