标签:java web 当前时间 timestamp postgresql
Timestamp currentTime= new Timestamp(System.currentTimeMillis());
String sql = "INSERT INTO message(date_create) VALUES (" + "‘" + currentTime + "‘" + ");";
Timestamp currentTime= new Timestamp(System.currentTimeMillis());
String sql = "INSERT INTO message( date_create) VALUES (?);";
PreparedStatement pst = conn.prepareStatement(sql,Statement.RETURN_GENERATED_KEYS);
pst.setTimestamp(1, currentTime);
pst.executeUpdate();
pst.close();
String sql = "INSERT INTO message(date_create) VALUES (LOCALTIMESTAMP);";
标签:java web 当前时间 timestamp postgresql
原文地址:http://blog.csdn.net/u012948976/article/details/46276695