1 | PreparedStatements inherit all functionality of Statements. |
2 | It may have an IN parameter, which will be indicated by a "?" in the SQL statement. |
3 | Each IN parameter is specified in number order from left to right by a setxxx method. ResultSet rs = stmt.executeQuery("select * from tb1 where name = ?"); stmt.setString(1, "bill"); |
4 | The setxxx methods will convert parameters to appropriate SQL types, or user may use more general stmt.setObject(1, value, "SQLtype"); |