Forums Register Login

Inserting Java Date in MySQL as Datetime

+Pie Number of slices to send: Send
Hi, I am trying to insert a date from Java to a MySQL database (DATETIME) using Hibernate. Hibernate maps a Datetime as a java.util.Date but this class has many methods which have been deprecated. I don't know what I'm supposed to do. Thanks for any help
+Pie Number of slices to send: Send
What's the problem? Just don't use the deprecated methods.
+Pie Number of slices to send: Send
I know I must not use them. I guess my real question is: what steps should I follow to correctly insert a Datetime in MySQL using Hibernate?
+Pie Number of slices to send: Send
You'll need to be more specific as to what your problem is. The whole point of Hibernate is that you shouldn't need to worry about the details. Is your question that you are unsure how to go about mapping Date fields?
+Pie Number of slices to send: Send
Just because some methods are deprecated doesn't mean the *class* is deprecated.
+Pie Number of slices to send: Send
take a look at http://www.xmission.com/~goodhill/dates/datedeprecation.htm
------------------------------------------------------------------------------------------------------------


Spring Persistence with Hibernate
CLUCK LIKE A CHICKEN! Now look at this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 2354 times.
Similar Threads
comparing two dates
Date in Hibernate
count by current timestamp
how to compare sql date
Hibernate: MySql DATETIME to java.util.Date
The WEB SERVICES and JAX-RS Course
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 03:31:06.