Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PreparedStatement pstmt = con.prepareStatement(
- "SELECT * FROM analysis WHERE notes like ?");
- pstmt.setString(1, notes);
- ResultSet rs = pstmt.executeQuery();
- notes = notes
- .replace("!", "!!")
- .replace("%", "!%")
- .replace("_", "!_")
- .replace("[", "![");
- PreparedStatement pstmt = con.prepareStatement(
- "SELECT * FROM analysis WHERE notes LIKE ? ESCAPE '!'");
- pstmt.setString(1, notes + "%");
- pstmt.setString(1, "%" + notes);
- pstmt.setString(1, "%" + notes + "%");
- PreparedStatement pstmt = con.prepareStatement(
- "SELECT * FROM analysis WHERE notes like ?");
- pstmt.setString(1, notes + "%");`
- pstmt.setString(1,"'%"+ notes + "%'");
- PreparedStatement ps = cn.prepareStatement("Select * from Users where User_FirstName LIKE ?");
- ps.setString(1, name + '%');
Advertisement
Add Comment
Please, Sign In to add comment