Home  >  Article  >  Database  >  mysql模糊查询匹配特殊字符

mysql模糊查询匹配特殊字符

WBOY
WBOYOriginal
2016-06-07 15:24:361953browse

StringBuilder selectStatement = new StringBuilder(128).append(select).append(verbosity.getColumnSelectFragment()); StringBuilder fromStatement =new StringBuilder(128).append(from).append(tableName).append(where); fromStatement.append(COLUM

StringBuilder selectStatement = new StringBuilder(128).append("select").append(verbosity.getColumnSelectFragment());
StringBuilder fromStatement =new StringBuilder(128).append("from").append(tableName).append("where");

fromStatement.append(COLUMN.NAME.aliasAndName).append("like ? escape ?");

List params = new ArrayList();

params.add("%" + DB_ADAPTER.escapeAllWildcardsForLikeStatement(name) + "%");
params.add(DB_ADAPTER.getLikeEscapeSequence());
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn