using executeupdate to delete record from mysql database(netbeans)
<p>I am using NetBeans 8.1.
I was trying to delete a record from my mysql database. The record is deleted successfully but i always get the same message from  my JOptionPane "Deleted successflly" even if the username and password is wrong. If the user and pass is right, it deletes the record successfully. 
How can i put a condition on my 'executeupdate' so that i get a different message if the details doesn't match any record. 
Here is my code:</p>

<pre><code>int a=JOptionPane.showConfirmDialog(rootPane, "Delete account?");
    if(a==JOptionPane.YES_OPTION){
    String passchk=enterpass.getText();
    String userchk=enteruser.getText();


    try{
    Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/login_info", "root", "root");
    Statement st=con.createStatement();
    String sql="delete from users_info where"
            + " password='"+passchk+"'and username='"+userchk+"';";
    st.executeUpdate(sql);    


    JOptionPane.showMessageDialog(null , "Deleted successfully");

    }
    catch(SQLException error){
        JOptionPane.showMessageDialog(null, "error");

    }
    enterpass.setText("");
    enteruser.setText("");
    }
    else {
        setVisible(true);
        cnfmdel.setVisible(false);
        passconfirm.setVisible(false);
    }
</code></pre>