I have an object and its attribute is calendar type, now I want to run a query in database, so I create a preparedStatement, in the data base there is a field who its type is date.
But this error appears in the red line:
cannot find symbol
in interface preparedStatement
method setDate(int, java.util.Calendar)
Calendar d = new GregorianCalendar();
d.set(2007,6,6);
String insertEvent = "INSERT INTO EVENTS(DATE,TYPE,COMMENT) VALUES(?,?,?);";
ConnectionSingleton connection = ConnectionSingleton .getInstance();
PreparedStatement preparedInsert = connection.getConnection().prepareStatement(insertEvent);
preparedInsert.setDate(1,ev.getDate().getTime());
preparedInsert.setString(2,ev.getType());
preparedInsert.setString(3,ev.getComment());