I have used the LIKE
condition, but it required me to enter the full name into the database to find the name.
You need to iterate over the result set:
while (rs.next()) {
String name = rs.getString("Name");
System.out.println("Name: " + name);
}
It looks like you had it and commented it out? If you want to store it in a list you had it right. If you want to put all of the results into a String
for that tasearch.setText()
you could:
StringBuilder sb = new StringBuilder();
while (rs.next()) {
String name = rs.getString("Name");
sb.append(name + " ");
}
String names = sb.toString().trim();
tasearch.setText(names);