Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Retreiving the current data from the database

 
Hanna Habashy
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to get the date from the database. I can read it fin, but the hour, minutes, and sec values are missing.
Here is a segment of my code:


The value in sqlDate returned is 2009-09-03, however the value returned from the database console is 2009-09-03 12:16:13.747

How can I get the full date?
I tried use Date.getTime(), cast it to java.util.Date, not it not working.

Your help is appreciated.
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried with rs.getTimestamp(1) ??

 
Hanna Habashy
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rene Larsen wrote:Have you tried with rs.getTimestamp(1) ??



Thank you very much, this solved it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic