我试过了..
MCorr mc = new MCorr();
PreparedStatement ps = conn.prepareStatement("SELECT * FROM mcorr");
ResultSet rs = ps.executeQuery();
while(rs.next()){
mc.setDateMaint(rs.getDate("dateMaint"));
}
然后这个
MCorr mc = new MCorr();
PreparedStatement ps = conn.prepareStatement("SELECT * FROM mcorr");
ResultSet rs = ps.executeQuery();
while(rs.next()){
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-mm-dd hh:MM");
java.util.Date date = sdf1.parse(rs.getString("dateMaint"));
java.sql.Date sqlDate = new Date(date.getTime());
mc.setDateMaint(sqlDate );
}
但无论如何它只显示没有小时和分钟的日期..
在MCorr课程中
private Date dateMaint;
我该怎么办才能得到日期和时间..