| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: JDBC Timestamp comparison
public void testQuery() {
Connection con = null;
Statement stmt = null;
ResultSet resultSet = null;
try {
con = getConnection();
stmt = con.createStatement();
String sql = "select * from message_log where log_timestamp
resultSet = stmt.executeQuery(sql);
if(resultSet.next()) {
System.out.println("Trade No XX: " +
resultSet.getInt(1));
System.out.println("Message Timestamp: " +
resultSet.getTimestamp(2).getTime());
}
} catch (Exception e) {
e.printStackTrace();
System.out.println("Error running test " + e.getMessage());
} finally {
closeConnection(resultSet, stmt, con);
}
![]() |
![]() |