how to use SQL LIKE in JDBC?

Tried to use the following syntax of "LIKE" in JDBC, but doesn't work with mysql 4.1:

String jsql =

"select IMG_ID,IMG_File_S FROM image WHERE IMG_Region=? and IMG_Tissue LIKE '%' ? '%' ";

pstmt = con.prepareStatement(jsql);

pstmt.setString(1, IMG_Region);

pstmt.setString(2, IMG_Tissue);

what's the right syntax to use "LIKE"? thanks a lot!

[392 byte] By [pelhama] at [2007-10-1 2:25:32]
# 1
When you call preparedStatement.setString(), place the wildcards (%) in the actual string. Remove them from the SQL. Simply leave the bind variable placeholder (?).- Saish
Saisha at 2007-7-8 11:33:43 > top of Java-index,Administration Tools,Sun Connection...