Anytime I have to handle dates/times in java it makes me sad
I\'m trying to parse a string and turn it into a date object to insert in a preparepared statement. I\'ve b
String to MySQL Date/Time
import java.sql.Date;
import java.sql.Time;
statement.setDate(4, Date.valueOf("2009-08-26"));
statement.setTime(5, Time.valueOf("12:04:08"));
My guess is that you mixed java.util.Date and java.sql.Date ...
PreparedStatement.setDate takes a java.sql.Date, not a java.util.Date.
(Out of interest, how come you're not actually seeing this as a compile-time error? Your life will become a lot easier if you can resolve compilation failures without having to get to that point in a test run...)