RowSet & Oracle(ojdbc6.jar)
The below result of a test today with ojdbc6.jar in oracle database.
Connection con =null;
Statement stmt=null;
Connection con =
DriverManager.getConnection( “jdbc:oracle:thin:@127.0.0.1:1521:test”, User,PW);
stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from table1");
// 1 CachedRowSet is ok.
CachedRowSet rowSet;
rowSet=new CachedRowSetImpl();
rowSet.populate(rs); // It work
//2 JdbcRowSet is not ok. Don't know why?
// JdbcRowSet rowSet = new JdbcRowSetImpl(rs); // It doesn't work
rs.close();
stmt.close();
con.close();
Connection con =null;
Statement stmt=null;
Connection con =
DriverManager.getConnection( “jdbc:oracle:thin:@127.0.0.1:1521:test”, User,PW);
stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from table1");
// 1 CachedRowSet is ok.
CachedRowSet rowSet;
rowSet=new CachedRowSetImpl();
rowSet.populate(rs); // It work
//2 JdbcRowSet is not ok. Don't know why?
// JdbcRowSet rowSet = new JdbcRowSetImpl(rs); // It doesn't work
rs.close();
stmt.close();
con.close();
评论
发表评论