try{
String b = jTextField1.getText();
String sql = "SELECT * FROM DataImput ORDER BY InvoiceNumber=?";
pst=conn.prepareStatement(sql);
pst.setString(1, b);
rs=pst.executeQuery();
jTable1.setModel(DbUtils.resultSetToTableModel(rs));
}
catch(Exception e){
JOptionPane.showMessageDialog(null, e);
} finally{
try{
rs.close();
pst.close();
}
catch(Exception e){
}
}
}
this is the code I work to search. it actually work. but really weird. it show the item I want the last one. and show all items in it. how can I make it show only search data?
items = data I've enter inside