My concept is that I have to select an item in first combobox. It will add up some items to the second combo box, based on the selection. Once, the second combobox is selected, then some access table data is retrieved.
Finally, when I click Delete
, the record has to get deleted based on the item present in the two combo box.
I get the record correctly deleted. But, my problem is, I'm getting an error dialog(which I used in catch) everytime with a
No resultset produced
error in the command prompt, though the deletion happens correctly. I want to know, what's going on inside. Kindly help me diagnose.
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn=DriverManager.getConnection("jdbc:odbc:vasantham","","");
Statement st=conn.createStatement();
ResultSet rs=st.executeQuery("delete from try where tname='"+scb+"' and Purpose='"+scp+"'");
JOptionPane.showMessageDialog(null,"Your entry has been DELETED successfully!!!");
}
catch(Exception e)
{
JOptionPane.showMessageDialog(null,"Error!Try again!");
System.out.println(e);
}