代码 :
OracleCachedRowSet rowSet = new OracleCachedRowSet();
ResultObject obj = new ResultObject(0,null);
PreparedStatement pstat = connection.prepareStatement(strQry);
rowSet.populate(pstat.executeQuery());
rowSet.beforeFirst();
while(rowSet.next()){
System.out.println("Conference name "+rowSet.getString(1));
System.out.println("StartTime "+rowSet.getTimestamp(5)) ;
}
当我运行上面的代码时,出现如下错误:
java.sql.SQLException: Invalid column type
at oracle.jdbc.rowset.OracleCachedRowSet.getTimestamp(OracleCachedRowSet.java:4399)
at test.Test.main(Test.java:102)
ResultSet
如果我使用而不是,同样的事情工作正常(检查下面的正确代码)OracleCachedRowSet
PreparedStatement pstat = connection.prepareStatement(strQry);
ResultSet rset = pstat.executeQuery();
while(rset.next()){
System.out.println("Conference name "+rset.getString(1));
System.out.println("StartTime "+rset.getTimestamp(5)) ;
}
有什么方法可以getTimestamp()
使用OracleCachedRowSet
吗?