Reputation: 16525
I select ts from database: ts = Select ts from ...
so now I have oracle.sql.TIMESTAMP in my variable. Now I need to select all record with this timestam:
select * from ... where time = ts
How I can to this ?
Upvotes: 1
Views: 150
Reputation: 4693
Try PreparedStatement
(Javadoc):
PreparedStatement pstmt = connection.prepareStatement("select * from ... where time = ?");
pstmt.setTimestamp(1, timestamp);
ResultSet rs = pstmt.executeQuery;
Upvotes: 4