@Override public String getSQL(boolean isDistributed) { if (table == null) { return "*"; } return StringUtils.quoteIdentifier(table) + ".*"; }
private static String translate(String key, String... params) { String message = null; if (MESSAGES != null) { // Tomcat sets final static fields to null sometimes message = MESSAGES.getProperty(key); } if (message == null) { message = "(Message " + key + " not found)"; } if (params != null) { for (int i = 0; i < params.length; i++) { String s = params[i]; if (s != null && s.length() > 0) { params[i] = StringUtils.quoteIdentifier(s); } } message = MessageFormat.format(message, (Object[]) params); } return message; }
private void appendTableName(StatementBuilder buff) { if (schemaName != null && schemaName.length() > 0) { buff.append(StringUtils.quoteIdentifier(schemaName)).append('.'); } buff.append(StringUtils.quoteIdentifier(tableName)); }
/** * Add double quotes around an identifier if required. * * @param s the identifier * @return the quoted identifier */ public static String quoteIdentifier(String s) { if (s == null || s.length() == 0) { return "\"\""; } char c = s.charAt(0); // lowercase a-z is quoted as well if ((!Character.isLetter(c) && c != '_') || Character.isLowerCase(c)) { return StringUtils.quoteIdentifier(s); } for (int i = 1, length = s.length(); i < length; i++) { c = s.charAt(i); if ((!Character.isLetterOrDigit(c) && c != '_') || Character.isLowerCase(c)) { return StringUtils.quoteIdentifier(s); } } if (isKeyword(s, true)) { return StringUtils.quoteIdentifier(s); } return s; }
private void appendColumnList(StatementBuilder buff, boolean set) { buff.resetCount(); for (int i = 0; i < columnCount; i++) { buff.appendExceptFirst(","); String col = result.getColumnName(i); buff.append(StringUtils.quoteIdentifier(col)); if (set) { buff.append("=? "); } } }
private void appendKeyCondition(StatementBuilder buff) { buff.append(" WHERE "); buff.resetCount(); for (String k : key) { buff.appendExceptFirst(" AND "); buff.append(StringUtils.quoteIdentifier(k)).append("=?"); } }
for (String p : path) { buff.appendExceptFirst(", "); buff.append(StringUtils.quoteIdentifier(p)); "SET SCHEMA " + StringUtils.quoteIdentifier(schema));