Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

CachedRowSet, populate and the date format

 
Luca Luca
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
look this
...
ResultSet resultset = (ResultSet) cstmt.getObject(firstOutParameter);
while (resultset.next()){
logger.info("order_date: " + resultset.getString("ORDER_DATE")); //ORDER_DATE is a Date
}
...
in this case i've something like this:
order_date: 2006-12-12 11:24:12.0

now look this
...
ResultSet resultset = (ResultSet) cstmt.getObject(firstOutParameter);
CachedRowSet rowset = new CachedRowSetImpl();
rowset.populate(resultset);
while (rowset.next()) {
logger.info("order_date: " + rowset.getString("ORDER_DATE")); //ORDER_DATE is a Date
}
...
in this case i've something like this:
order_date: 2006-12-12

??? where is the time side of th date ? is there a way to say to "populate" to fill the Date field according to my format?

any help is appreciated.

tnx,
Luca
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34087
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Luca,
Welcome to JavaRanch!

Try using get timestamp instead of get string. GetString is more dependent on the driver.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic