I am trying to filter in a database from a combobox, for example if in the combobox you choose systems in the table you should show the data of only that area, I have this code:
String lugar=String.valueOf(combo.getSelectedItem());
ResultSet c=null;
try{
c=stat.executeQuery("select * from empleados where area= '"+lugar+"'");
}
catch(Exception e){
e.printStackTrace();
}
I have tried doing it from a textbox but it does not work, and I already probe in this way:
String lugar=String.valueOf(combo.getSelectedItem());
try{
stat.executeUpdate("select * from empleados where area= '"+lugar+"'");
}
catch(Exception e){
e.printStackTrace();
}