You ought to use prepared statements, since you declared them
Just some suggestion:
your connection assignment can be outside the if statements because all connections are the same.
for sql, the where clause is specific to the if condition, the stuff before that is already know before hand as if all records are selected (or no where clause)
The rs.xxx and JTable's setXXX can be outside the if statement since all conditions will do it