• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to insert a date and time in SQLServer 2005 using java

 
am rome
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,


i want to insert a date and time in sql server

am using jpa for connection

when am setting the data in my bean [ ilogmaster.setsatuschddate(new Date());]

but in database it saving the only the date not time

how can i insert date and time in the sql server 2005,

in the database field is datetime

please look the attachment


Thanks
venkat
sqldate.JPG
[Thumbnail for sqldate.JPG]
sqlserver database
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34229
341
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are using @Temporal to identify which type of date and/or time you want stored?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic