I am trying to use a java.util.Date as input and then creating a query with it - so I need a java.sql.Date.
I was surprised to find that it couldn\'t do the conver
Converting java.util.Data to java.sql.Data will loose hour, minute and second. So if it is possible, I suggest you use java.sql.Timestamp like this:
java.util.Data
java.sql.Data
java.sql.Timestamp
prepareStatement.setTimestamp(1, new Timestamp(utilDate.getTime()));
For more info, you can check this question.