I need to add the current date into a prepared statement of a JDBC call. I need to add the date in a format like yyyy/MM/dd.
I\'ve try with
all you have to do is this
Calendar currenttime = Calendar.getInstance(); //creates the Calendar object of the current time
Date sqldate = new Date((currenttime.getTime()).getTime()); //creates the sql Date of the above created object
pstm.setDate(6, (java.sql.Date) date); //assign it to the prepared statement (pstm in this case)