Code example for PreparedStatement

Methods: executeUpdatesetLongsetTimestampclose

0
            "INSERT INTO \"CASH_CURRENCY\" VALUES(135,23)"); 
 
        PreparedStatement ps = conn.prepareStatement("insert into "
            + nameTable + "(T, ID) values (?, ?)");
 
        ps.setTimestamp(1, testTS);
        ps.setLong(2, id);
        ps.executeUpdate();
        ps.close();
 
        ps = null;
 
        conn.commit();
    } 
 
    private void createTestTable(String sql) throws Exception {
 
        Statement ps = conn.createStatement();
 
        ps.execute(sql);
Contextual code suggestions in your IDE  Get Codota for Java