get timestamp using OracleCachedRowSet
Posted
by
chetan
on Stack Overflow
See other posts from Stack Overflow
or by chetan
Published on 2012-10-17T10:58:51Z
Indexed on
2012/10/17
11:00 UTC
Read the original article
Hit count: 201
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
© Stack Overflow or respective owner