Description
The following content is a Chinese translation
Use the u& prefix for non-ANSII characters. This method is not supported in Oracle, and should be replaced with the unistr function.
Modify as follows
public class CustomOracleSqlDialect extends OracleSqlDialect { private static final char[] HEXITS = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', }; public static final SqlDialect DEFAULT = new CustomOracleSqlDialect(DEFAULT_CONTEXT); public CustomOracleSqlDialect(Context context) { super(context); } @Override public void quoteStringLiteralUnicode(StringBuilder buf, String val) { buf.append("unistr('"); for (int i = 0; i < val.length(); i++) { char c = val.charAt(i); if (c < 32 || c >= 128) { buf.append('\\'); buf.append(HEXITS[(c >> 12) & 0xf]); buf.append(HEXITS[(c >> 8) & 0xf]); buf.append(HEXITS[(c >> 4) & 0xf]); buf.append(HEXITS[c & 0xf]); } else if (c == '\'' || c == '\\') { buf.append(c); buf.append(c); } else { buf.append(c); } } buf.append("')"); } }