This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Date to MySQL Date

 
Tulika Shil
Greenhorn
Posts: 3
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Date date = new Date();
SimpleDateFormat sdf = SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String currentdate = sdf.format(date);
The cuurrentdate put into columns.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic