This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes Java Date to MySQL Date Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Java Date to MySQL Date" Watch "Java Date to MySQL Date" New topic
Author

Java Date to MySQL Date

Tulika Shil
Greenhorn

Joined: Jan 09, 2012
Posts: 3
I want to insert the date into one of the columns of a table in MySQL from my jsp page. The datatype of that column is 'date'. How to convert the Java date to MySQL date?
ravi varagani
Greenhorn

Joined: Mar 20, 2013
Posts: 1
Date date = new Date();
SimpleDateFormat sdf = SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String currentdate = sdf.format(date);
The cuurrentdate put into columns.
 
Consider Paul's rocket mass heater.
 
subject: Java Date to MySQL Date
 
Similar Threads
How to Inserting current Date to DataBase
storing date in database
Date in Hibernate
datetime conversion
Hibernate Date mapping