BloodLoss:
This question already has an answer here:
- What does “if (rs.next())” mean? 7 answers
String id = (jTable1.getValueAt(row, 4).toString());
int x = JOptionPane.showConfirmDialog(this, "Do You Want To Delete This Author ?", "Confirmation", JOptionPane.YES_NO_OPTION);
if (x == 0) {
try{
ResultSet code = DB.getdata("SELECT bm_id FROM book_master WHERE au_id='"+id+"'");
if(**code.next()**){
DB.setdata("UPDATE author SET activestatus='0' WHERE author_id='"+id+"'");
}
else{
DB.setdata("DELETE FROM author WHERE author_id='"+id+"'");
}
Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
This Question have been answered
HERE