• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with java.sql.date

 
HimaBindu Gudey
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have a problem with java.sql.Date.I want to store date and time in database where the field type is Date. From java I want to insert date and time .The method takes java.sql.Date.If I am using like this
row.setAdtDttm(new Date(System.currentTimeMillis())) ,only the date is getting stored.And time is stored as 00:00:00.
Can anyboby has any clue how to resolve this.
 
Annie Smith
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use java.sql.Timestamp instead.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic