时间类型入库
关于preparedstatement插入时间时,只能采用timestamp 类型,否则入库后,会发现时间精度丢失的问题,
下面提供一种转换方法:
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); java.util.Date end = sdf.parse(objMeetingVO.getMeetingEnd()); java.util.Date begin = sdf.parse(objMeetingVO.getMeetingBegin()); Timestamp endStamp = new Timestamp(end.getTime()); Timestamp startStamp = new Timestamp(begin.getTime());