I have a set of fields which I need to save into my database, my problem is that the format with java and mysql doesn't match. I converted everything to String which works but I need to store the data as Date. As I will need to retrieve information between these two dates.
Java has two Date classes, one in java.util (that's the normal Java Date that connects to Calendar etc) and one in java.sql (that's the SQL-compatible version).
Both classes have methods to get and set their value as a long, so you can use a long value to convert easily between them.
Your earlier code had a correct converion (line 2). Use that example to understand the correct way to do this.
ps: "still there is an error"? You should ALWAYS post the complete text of any error messages. Nobody here has the time to guess what the error message could be.
i have a problem with jdatechooser, when i added a day with format yyyy-mm-dd (same mysql) it have a error is: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect date value: 'Tue Jan 01 00:01:00 ICT 2013' for column 'day' at row 1