private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
String del_user = JOptionPane.showInputDialog(null,"Enter the Username To be deleted :" ,"Delete User !", JOptionPane.WARNING_MESSAGE);
try {
stmt = con.createStatement();
String quer = "delete from Udet where username='"+del_user+"'";
rs=stmt.executeQuery(quer);
int count=0;
while(rs.next())
{
count++;
}
if(count==1)
{
JOptionPane.showMessageDialog(null,"The user has been deleted");
}
else
{
JOptionPane.showMessageDialog(null,"No such User Exists");
}
} catch(Exception e){}
}
THE QUERY EXECUTES FINE ! THE RECORD GETS DELETED BUT THE LINES AFTER QUERYEXECUTION ARE NOT EXECUTING ... the JOptionPane will work after the try block but then the value of count wont be determined...