This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • 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: 34837
369
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