public void insert(Project project) {
Connection conn=null;
PreparedStatement stmt=null;
String sql=null;
try {
conn=ConnectionUtils.openConnection();
sql="insert into t_project(t_no,t_name,t_start_date,t_end_date) values(?,?,?,?)";
stmt=conn.prepareStatement(sql);
stmt.setString(1, project.getNo());
stmt.setString(2, project.getName());
stmt.setDate(3,(Date)project.getStartDate());//这样写不报错,但是运行时出错 1
stmt.setDate(4, (Date)project.getEndDate());// 2
stmt.execute();
java.lang.RuntimeException: java.lang.ClassCastException: java.util.Date cannot be cast to java.sql.Date//这是运行时的错
该怎么样去1,2所对应的代码呢?