Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to use SQL "LIKE" in JDBC?

843854Jan 12 2005 — edited Aug 8 2007
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!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 5 2007
Added on Jan 12 2005
12 comments
532 views