Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) 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
Sheriff
Posts: 35975
422
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.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!