如何使用H2 Database检索服务器的日期?我正在用Java开发一个应用程序,但在这个阶段我遇到了障碍。如何从Java代码中检索服务器的日期?
发布于 2012-02-20 20:26:31
你可以在手册中找到答案:
http://h2database.com/html/functions.html#current_timestamp
在Java中
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery("select current_timestamp() from dual");
rs.next();
Timestamp ts = rs.getTimestamp(1);
rs.close();
stmt.close();https://stackoverflow.com/questions/9361043
复制相似问题