wood burning stoves 2.0*
The moose likes JDBC and the fly likes unable to retrieve timestamp in my servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "unable to retrieve timestamp in my servlet" Watch "unable to retrieve timestamp in my servlet" New topic
Author

unable to retrieve timestamp in my servlet

Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 753
Hi

I'm using mysql as my backend. and when i say rs.getString("create_date"); in my sql its giving error.

the create_date field is of data type TIME STAMP which has the format
0000-00-00 00:00:00

is there anyway out i can get the date in the format 0000-00-00 or i can store the while timestamp value in the format 0000-00-00 00:00:00


Jigar Naik


Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2491
    
    8

Originally posted by Jigar Naik:
Hi

I'm using mysql as my backend. and when i say rs.getString("create_date"); in my sql its giving error.

the create_date field is of data type TIME STAMP which has the format
0000-00-00 00:00:00

is there anyway out i can get the date in the format 0000-00-00 or i can store the while timestamp value in the format 0000-00-00 00:00:00

It would be usefull to tell us exactly what error you get.

Timestamps can be retrieved by using (pseudocode):


You can format this Date as you please, using the SimpleDateFormat.

Regards, Jan


OCUP UML fundamental and ITIL foundation
youtube channel
Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 753
ya i tried that one but still getting error...

ERROR :
Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 753
ok problem solved. actually there was a blank tuple in my table. thats why it was giving error.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: unable to retrieve timestamp in my servlet
 
Similar Threads
Hexadecimal to decimal
how to insert timestamp into derby databse
unable to retrieve timestamp in my servlet
add 10 days to currentDate in java.util.Date or cast to Calendar?
Problem while converting datatime to timestamp