code_junkie

SQL exception when trying make an prepared statement

Nov 13th, 2011
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. private static final String QUICK_SEARCH = "select * from c where NAME like '% ? %'";
  2.  
  3. SELECT * FROM c WHERE name LIKE CONCAT('%', ?, '%')
  4.  
  5. pstmt.setString(1, "%" + name + "%");
Add Comment
Please, Sign In to add comment