datetime 保存的时间范围较大,年的数字在:1000---9999之间
timestamp 保存的时间较小,年的数字在:1970 --2037 之间
http://jingyan.baidu.com/article/a65957f49271a824e67f9b84.html
请参考public static void insertDemo(String[] args) throws Exception {
MsgSwapDAOImpl dao = new MsgSwapDAOImpl()
Connection conn = dao.jdbcUtil.getConnection()
String appKey ="40825Td288461463"
String msg = "wlllllll"
conn.setAutoCommit(false)
String sql = "insert into TTT(ID, CREATE_DATE) values(?,?)"
PreparedStatement pstmt = conn.prepareStatement(sql)
pstmt.setInt(1, 888888)
pstmt.setTimestamp(2, TimeUtil.nowTimestamp())
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)