时间:2021-07-01 10:21:17 帮助过:61人阅读
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中向postgreSQL插入当前时间
标签:java web 当前时间 timestamp postgresql