PreparedStatement pst.setTimestamp

String sdate = vo.getDate();
sdate = "2013-03-29 21:55:59";
java.util.Date du = sdf.parse(sdate);
java.sql.Timestamp st = new java.sql.Timestamp(du.getTime());
pst.setTimestamp(2, st);

这样就能存进oralce中对应的date日期类型了,年月日,时分秒都有了,不用转换

你可能感兴趣的:(PreparedStatement pst.setTimestamp)