- To prepare a query to get the bank account information for a
given account
String query = "SELECT * WHERE Account_Number = ?";
PreparedStatement prepStat =
conn.prepareStatement(query);
- The ? denotes variables that you fill in when you make an
actual query
- Use the set method to set the variables
prepStat.setString(1,accountNumber);
- When you have all variables set, call the executeQuery method
ResultSet result = prepStat.executeQuery();