aspose file tools*
The moose likes Object Relational Mapping and the fly likes inserting the datetime into oracle through hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "inserting the datetime into oracle through hibernate" Watch "inserting the datetime into oracle through hibernate" New topic
Author

inserting the datetime into oracle through hibernate

amar sivas
Greenhorn

Joined: Jun 30, 2013
Posts: 2
Hi all,

I have timestamp column in oracle.So have to insert the datetime value into db with help of @temporal(temporaltype.timestamp) and @dateformat in hibernate entity.

Here problem is oracle is in the format of 12 hours format.But i need to insert the 24 hours format.

How can i insert the data with help @temporal(temporaltype.timestamp) and @dateformat.

can any body give me sugisions on this one

Thanks
Amar
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30764
    
156

Amar,
I'm not aware Oracle has a 12 hour based time. Isn't that just for display? That means you would get the right Date back into Java and use SimpleDateFormat to display in the desired format.


[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
amar sivas
Greenhorn

Joined: Jun 30, 2013
Posts: 2
Jeanne Boyarsky wrote:Amar,
I'm not aware Oracle has a 12 hour based time. Isn't that just for display? That means you would get the right Date back into Java and use SimpleDateFormat to display in the desired format.



Hi Jeanne,thanks for reply.

i have asked about the insertion of the date into oracle,while i am inserting i am change date format with simpleformat.

But the date is inserted in the oracle 12 hours format.

So i think what ever format it is, the oracle might have converted into default format.

So i could not inserted the date with out own format into oracle.

please tell me am i correct or wrong.

Thanks,
Amar
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: inserting the datetime into oracle through hibernate