File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases 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
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Java Date to MySQL Date" Watch "Java Date to MySQL Date" New topic

Java Date to MySQL Date

Tulika Shil

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

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.
I agree. Here's the link:
subject: Java Date to MySQL Date
It's not a secret anymore!