我从数据库中选择 ts:ts =Select ts from ...
所以现在我的变量中有 oracle.sql.TIMESTAMP。现在我需要选择具有此时间戳的所有记录:
select * from ... where time = ts
我怎么能这样?
尝试PreparedStatement
(Javadoc):
PreparedStatement pstmt = connection.prepareStatement("select * from ... where time = ?");
pstmt.setTimestamp(1, timestamp);
ResultSet rs = pstmt.executeQuery;