This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes CachedRowSet, populate and the date format Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "CachedRowSet, populate and the date format" Watch "CachedRowSet, populate and the date format" New topic
Author

CachedRowSet, populate and the date format

Luca Luca
Greenhorn

Joined: Dec 13, 2006
Posts: 1
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

Joined: May 26, 2003
Posts: 32302
    
213

Luca,
Welcome to JavaRanch!

Try using get timestamp instead of get string. GetString is more dependent on the driver.


[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: CachedRowSet, populate and the date format
 
It's not a secret anymore!