private static String[] split(String s) { String[] list = new String[10]; String[] t = StringUtils.arraySplit(s, ' ', true); System.arraycopy(t, 0, list, 0, t.length); for (int i = 0; i < list.length; i++) { if ("null".equals(list[i])) { list[i] = null; } } return list; }
private static void setIgnoreList(FullTextSettings setting, String commaSeparatedList) { String[] list = StringUtils.arraySplit(commaSeparatedList, ',', true); setting.addIgnored(Arrays.asList(list)); }
/** * Convert a String to a map. * * @param s the string * @return the map */ public static SortedProperties fromLines(String s) { SortedProperties p = new SortedProperties(); for (String line : StringUtils.arraySplit(s, '\n', true)) { int idx = line.indexOf('='); if (idx > 0) { p.put(line.substring(0, idx), line.substring(idx + 1)); } } return p; }
private String getFunctions(String section) throws SQLException { try { checkClosed(); PreparedStatement prep = conn.prepareAutoCloseStatement("SELECT TOPIC " + "FROM INFORMATION_SCHEMA.HELP WHERE SECTION = ?"); prep.setString(1, section); ResultSet rs = prep.executeQuery(); StatementBuilder buff = new StatementBuilder(); while (rs.next()) { String s = rs.getString(1).trim(); String[] array = StringUtils.arraySplit(s, ',', true); for (String a : array) { buff.appendExceptFirst(","); String f = a.trim(); if (f.indexOf(' ') >= 0) { // remove 'Function' from 'INSERT Function' f = f.substring(0, f.indexOf(' ')).trim(); } buff.append(f); } } rs.close(); prep.close(); return buff.toString(); } catch (Exception e) { throw logAndConvert(e); } }
Utils.callStaticMethod(browser, url); } else if (browser.contains("%url")) { String[] args = StringUtils.arraySplit(browser, ',', false); for (int i = 0; i < args.length; i++) { args[i] = StringUtils.replaceAll(args[i], "%url", url);
private void readSettingsFromURL() { DbSettings defaultSettings = DbSettings.getDefaultSettings(); int idx = url.indexOf(';'); if (idx >= 0) { String settings = url.substring(idx + 1); url = url.substring(0, idx); String[] list = StringUtils.arraySplit(settings, ';', false); for (String setting : list) { if (setting.length() == 0) { continue; } int equal = setting.indexOf('='); if (equal < 0) { throw getFormatException(); } String value = setting.substring(equal + 1); String key = setting.substring(0, equal); key = StringUtils.toUpperEnglish(key); if (!isKnownSetting(key) && !defaultSettings.containsKey(key)) { throw DbException.get(ErrorCode.UNSUPPORTED_SETTING_1, key); } String old = prop.getProperty(key); if (old != null && !old.equals(value)) { throw DbException.get(ErrorCode.DUPLICATE_PROPERTY_1, key); } prop.setProperty(key, value); } } }
public ConnectionInfo(String data) { String[] array = StringUtils.arraySplit(data, '|', false); name = get(array, 0); driver = get(array, 1); url = get(array, 2); user = get(array, 3); }
if (cols != null) { Collections.addAll(indexList, StringUtils.arraySplit(cols, ',', true));
@Override public void contextInitialized(ServletContextEvent servletContextEvent) { try { org.h2.Driver.load(); // This will get the setting from a context-param in web.xml if // defined: ServletContext servletContext = servletContextEvent.getServletContext(); String url = getParameter(servletContext, "db.url", "jdbc:h2:~/test"); String user = getParameter(servletContext, "db.user", "sa"); String password = getParameter(servletContext, "db.password", "sa"); // Start the server if configured to do so String serverParams = getParameter(servletContext, "db.tcpServer", null); if (serverParams != null) { String[] params = StringUtils.arraySplit(serverParams, ' ', true); server = Server.createTcpServer(params); server.start(); } // To access the database in server mode, use the database URL: // jdbc:h2:tcp://localhost/~/test conn = DriverManager.getConnection(url, user, password); servletContext.setAttribute("connection", conn); } catch (Exception e) { e.printStackTrace(); } }
boolean allowAll = false; HashSet<String> classNames = new HashSet<>(); for (String p : StringUtils.arraySplit(s, ',', true)) { if (p.equals("*")) { allowAll = true;
String columns = rs.getString(2); if (columns != null) { Collections.addAll(indexList, StringUtils.arraySplit(columns, ',', true));
session.put("tool", toolName); String args = (String) attributes.get("args"); String[] argList = StringUtils.arraySplit(args, ',', false); Tool tool = null; if ("Backup".equals(toolName)) {
int parent = row.getValue(2).getInt(); int rootPageId = row.getValue(3).getInt(); String[] options = StringUtils.arraySplit( row.getValue(4).getString(), ',', false); String columnList = row.getValue(5).getString(); String[] columns = StringUtils.arraySplit(columnList, ',', false); Index meta; if (trace.isDebugEnabled()) {
fileEncryptionKey = MathUtils.secureRandomBytes(32); String[] servers = StringUtils.arraySplit(server, ',', true); int len = servers.length; transferList.clear();
String[] keyValuePairs = StringUtils.arraySplit(options, ' ', false); for (String pair : keyValuePairs) { if (pair.length() == 0) {
} else if (isBuiltIn(sql, "@tables")) { String[] p = split(sql); String[] types = p[4] == null ? null : StringUtils.arraySplit(p[4], ',', false); return meta.getTables(p[1], p[2], p[3], types); } else if (isBuiltIn(sql, "@table_privileges")) { types = null; } else { String[] t = StringUtils.arraySplit(p[4], ',', false); types = new int[t.length]; for (int i = 0; i < t.length; i++) {
String[] columns = StringUtils.arraySplit(columnList, fieldSeparator, true); ResultSet rs = null; ValueResultSet x;
String[] columns = StringUtils.arraySplit(columnList, fieldSeparator, true); try {
private static String[] split(String s) { String[] list = new String[10]; String[] t = StringUtils.arraySplit(s, ' ', true); System.arraycopy(t, 0, list, 0, t.length); for (int i = 0; i < list.length; i++) { if ("null".equals(list[i])) { list[i] = null; } } return list; }
public ConnectionInfo(String data) { String[] array = StringUtils.arraySplit(data, '|', false); name = get(array, 0); driver = get(array, 1); url = get(array, 2); user = get(array, 3); }