File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes how to insert a date and time in SQLServer 2005 using java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "how to insert a date and time in SQLServer 2005 using java" Watch "how to insert a date and time in SQLServer 2005 using java" New topic
Author

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

am rome
Greenhorn

Joined: Feb 03, 2012
Posts: 1
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]

Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31075
    
232

Are using @Temporal to identify which type of date and/or time you want stored?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to insert a date and time in SQLServer 2005 using java