1public void prepStatmentExample(String parameter) throws SQLException {
2 Connection connection = DriverManager.getConnection(DB_URL, USER, PASS);
3 String query = "SELECT * FROM USERS WHERE lastname = ?";
4 PreparedStatement statement = connection.prepareStatement(query);
5 statement.setString(1, parameter);
6 System.out.println(statement);
7 ResultSet result = statement.executeQuery();
8
9 printResult(result);
10}