get timestamp using OracleCachedRowSet
- by chetan
Code :
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)) ;
}
When i run above code i got error like :
java.sql.SQLException: Invalid column type
at oracle.jdbc.rowset.OracleCachedRowSet.getTimestamp(OracleCachedRowSet.java:4399)
at test.Test.main(Test.java:102)
Same thing is working fine(check below correct code) if i use ResultSet instead of 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)) ;
}
Is there any way to getTimestamp() using OracleCachedRowSet