• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

unable to retrieve timestamp in my servlet

 
Ranch Hand
Posts: 763
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Bartender
Posts: 2661
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Jigar Naik
Ranch Hand
Posts: 763
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ya i tried that one but still getting error...

ERROR :
 
Jigar Naik
Ranch Hand
Posts: 763
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok problem solved. actually there was a blank tuple in my table. thats why it was giving error.
 
reply
    Bookmark Topic Watch Topic
  • New Topic