有个模糊查询
String sql = "select * from emp e where e.name like '?|%'";
Map<String, Object> map = jdbcTemplate.queryForMap(sql, new Object[] { empCode});
上面的写法不对,请问如何做转义?
高洛峰2017-04-18 10:29:15
轉義後如下:
String sql = "select * from emp e where e.name like '?|/%' ESCAPE '/'";
網上有關模糊查詢中特殊字元(底線_,百分號%,方括號[],尖號^)的處理,可以搜尋詳細了解
伊谢尔伦2017-04-18 10:29:15
String sql = "select * from emp e where e.name like ? ";
Map