Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void deleteUser (String Name , String Surname ) throws Exception {
- Connection conn = (Connection) getConnection() ;
- try {
- PreparedStatement deleteEmployeeStatement = (PreparedStatement) conn.prepareStatement("DELETE FROM user WHERE Name = ? AND Surname = ?");
- deleteEmployeeStatement.setString(1, Name);
- deleteEmployeeStatement.setString(2, Surname );
- deleteEmployeeStatement.execute();
- deleteEmployeeStatement.close();
- conn.close() ;
- System.out.println("Success");
- } catch (SQLException e) {
- System.out.println(e.getMessage());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement