I have used the LIKE condition, but it required me to enter the full name into the database to find the name.
LIKE
Instead of this:
StringBuilder sb = new StringBuilder(); while (rs.next()) { String name = rs.getString("Name"); sb.append(name + " "); }
Use this:
List lstNames = new ArrayList(); while (rs.next()) { lstNames.add(rs.getString("Name")); }