在使用到批量操作时候,preparestatement设置时间,
(1)设置当前时间:pstmt.setTimestamp(2,new Timestamp(DBUtil.getSysDate().getTime()));
(2)设置已有的时间:pstmt.setString(2,new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getOptdate()))
在使用到批量操作时候,preparestatement设置时间,
(1)设置当前时间:pstmt.setTimestamp(2,new Timestamp(DBUtil.getSysDate().getTime()));
(2)设置已有的时间:pstmt.setString(2,new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getOptdate()))
转载于:https://my.oschina.net/luleilei516/blog/2046124