aspose file tools*
The moose likes JDBC and the fly likes Datatype in java to hold a timestamp or date value from database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Datatype in java to hold a timestamp or date value from database" Watch "Datatype in java to hold a timestamp or date value from database" New topic
Author

Datatype in java to hold a timestamp or date value from database

kapil gureja
Greenhorn

Joined: May 08, 2013
Posts: 2
Hey,

I have a time-stamp value stored in database. Now, I used getTimestamp method on resultset to get the value. But the problem which i am facing here is which datatype is used to hold the value returned by getTimestamp method. Same problem with getDate....
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18141
    
    8

The data type to hold the value returned by the getTimestamp() method is java.sql.Timestamp. Likewise the data type to hold the value returned by the getDate() method is java.sql.Date.

You can tell this is the case by looking at the API documentation for ResultSet, where it explicitly says that getTimestamp() returns a java.sql.Timestamp object and so on.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Datatype in java to hold a timestamp or date value from database
 
Similar Threads
Selecting * and specific sysdate format
select/insert Gif/Jpg Pic
how to diplay correct date & time ???
DynaActionForm and validator
Display of BigDecimals