can someone please tell me how to fix this thing? Im loosing my mind here. in a form this code work well. in other it doesn't
I create an other form, import everything again and it is not working!
try{
int row = Data_Table1.getSelectedRow();
String Table_click1 =(Data_Table1.getModel().getValueAt(row, 0).toString());
String sql = "SELECT * FROM BatchFiles where InvoiceNumber= '"+Table_click1+"'";
pst = conn.prepareStatement(sql);
rs = pst.executeQuery();
if(rs.next()){
String add1 = rs.getString("InvoiceNumber");
Date.setText(add1);
}
}catch(Exception e){
JOptionPane.showMessageDialog(null, e);
}finally{
try{
rs.close();
pst.close();
}
catch(Exception e){
}
}
it doesn't execute this code
if(rs.next()){
String add1 = rs.getString("InvoiceNumber");
Date.setText(add1);
does someone know how to fix this thing?