我想根据日期范围选择PostgreSQL行。我试过这个:
Date start;
Date end;
ps = conn.prepareStatement("SELECT * FROM SCHEDULE WHERE START_DATE = ? AND END_DATE = ?");
ps.setDate(1, (java.sql.Date) start);
ps.setDate(2, (java.sql.Date) end);
但是我得到了
java.lang.ClassCastException: java.util.Date cannot be cast to java.sql.Date
at com.crm.web.schedule.Schedule$1.loadEvents(Schedule.java:62)
如何正确选择日期范围?