I have fighting to get a IN parameter to work inside of a LIKE statement now for hours!
I am using a CachedRowSet, which I understand should follow the same rules as a PreparedStatement.
Here is the basic query:
CachedRowSet cache;
String sql = "SELECT x " +
"FROM Y " +
"WHERE z LIKE '?__'"
cache.setCommand(sql);
cache.setString(1, "someString");
someString is a known id but the database( by the way is PostgreSQL) entry has a unknown 2 char suffix.