Codota Logo
ConnectionInfo
Code IndexAdd Codota to your IDE (free)

How to use
ConnectionInfo
in
org.h2.server.web

Best Java code snippets using org.h2.server.web.ConnectionInfo (Showing top 20 results out of 315)

  • Common ways to obtain ConnectionInfo
private void myMethod () {
ConnectionInfo c =
  • Codota IconString data;new ConnectionInfo(data)
  • Codota Iconnew ConnectionInfo()
  • Codota IconWebServer webServer;String name;webServer.getSetting(name)
  • Smart code suggestions by Codota
}
origin: com.h2database/h2

/**
 * Save the current connection settings to the properties file.
 *
 * @return the file to open afterwards
 */
private String settingSave() {
  ConnectionInfo info = new ConnectionInfo();
  info.name = attributes.getProperty("name", "");
  info.driver = attributes.getProperty("driver", "");
  info.url = attributes.getProperty("url", "");
  info.user = attributes.getProperty("user", "");
  server.updateSetting(info);
  attributes.put("setting", info.name);
  server.saveProperties(null);
  return "index.do";
}
origin: com.h2database/h2

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);
}
origin: com.h2database/h2

ConnectionInfo info = settings.get(i);
if (info != null) {
  prop.setProperty(String.valueOf(len - i - 1), info.getString());
origin: com.h2database/h2

if (prop.size() == 0) {
  for (String gen : GENERIC) {
    ConnectionInfo info = new ConnectionInfo(gen);
    settings.add(info);
    updateSetting(info);
      break;
    ConnectionInfo info = new ConnectionInfo(data);
    settings.add(info);
    updateSetting(info);
origin: com.h2database/com.springsource.org.h2

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);
}
origin: com.h2database/com.springsource.org.h2

synchronized void saveSettings() {
  try {
    Properties prop = new SortedProperties();
    if (driverList != null) {
      prop.setProperty("drivers", driverList);
    }
    prop.setProperty("webPort", String.valueOf(port));
    prop.setProperty("webAllowOthers", String.valueOf(allowOthers));
    prop.setProperty("webSSL", String.valueOf(ssl));
    ArrayList settings = getSettings();
    int len = settings.size();
    for (int i = 0; i < len; i++) {
      ConnectionInfo info = (ConnectionInfo) settings.get(i);
      if (info != null) {
        prop.setProperty(String.valueOf(len - i - 1), info.getString());
      }
    }
    OutputStream out = FileUtils.openFileOutputStream(getPropertiesFileName(), false);
    prop.store(out, Constants.SERVER_PROPERTIES_TITLE);
    out.close();
  } catch (Exception e) {
    TraceSystem.traceThrowable(e);
  }
}
origin: traccar/traccar

@Override
public void init() {
  super.init();
  try {
    Field field = WebServlet.class.getDeclaredField("server");
    field.setAccessible(true);
    org.h2.server.web.WebServer server = (org.h2.server.web.WebServer) field.get(this);
    ConnectionInfo connectionInfo = new ConnectionInfo("Traccar|"
        + Context.getConfig().getString("database.driver") + "|"
        + Context.getConfig().getString("database.url") + "|"
        + Context.getConfig().getString("database.user"));
    Method method;
    method = org.h2.server.web.WebServer.class.getDeclaredMethod("updateSetting", ConnectionInfo.class);
    method.setAccessible(true);
    method.invoke(server, connectionInfo);
    method = org.h2.server.web.WebServer.class.getDeclaredMethod("setAllowOthers", boolean.class);
    method.setAccessible(true);
    method.invoke(server, true);
  } catch (NoSuchFieldException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {
    LOGGER.warn("Console reflection error", e);
  }
}
origin: org.wowtools/h2

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);
}
origin: com.eventsourcing/h2

ConnectionInfo info = settings.get(i);
if (info != null) {
  prop.setProperty(String.valueOf(len - i - 1), info.getString());
origin: com.h2database/h2

ConnectionInfo info = new ConnectionInfo(data);
url = info.url;
user = info.user;
origin: com.eventsourcing/h2

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);
}
origin: org.wowtools/h2

ConnectionInfo info = settings.get(i);
if (info != null) {
  prop.setProperty(String.valueOf(len - i - 1), info.getString());
origin: com.h2database/h2

ConnectionInfo info = server.getSetting(setting);
if (info == null) {
  info = new ConnectionInfo();
origin: com.h2database/com.springsource.org.h2

private String settingSave() {
  ConnectionInfo info = new ConnectionInfo();
  info.name = attributes.getProperty("name", "");
  info.driver = attributes.getProperty("driver", "");
  info.url = attributes.getProperty("url", "");
  info.user = attributes.getProperty("user", "");
  server.updateSetting(info);
  attributes.put("setting", info.name);
  server.saveSettings();
  return "index.do";
}
origin: org.wowtools/h2

/**
 * Save the current connection settings to the properties file.
 *
 * @return the file to open afterwards
 */
private String settingSave() {
  ConnectionInfo info = new ConnectionInfo();
  info.name = attributes.getProperty("name", "");
  info.driver = attributes.getProperty("driver", "");
  info.url = attributes.getProperty("url", "");
  info.user = attributes.getProperty("user", "");
  server.updateSetting(info);
  attributes.put("setting", info.name);
  server.saveProperties(null);
  return "index.do";
}
origin: com.eventsourcing/h2

/**
 * Save the current connection settings to the properties file.
 *
 * @return the file to open afterwards
 */
private String settingSave() {
  ConnectionInfo info = new ConnectionInfo();
  info.name = attributes.getProperty("name", "");
  info.driver = attributes.getProperty("driver", "");
  info.url = attributes.getProperty("url", "");
  info.user = attributes.getProperty("user", "");
  server.updateSetting(info);
  attributes.put("setting", info.name);
  server.saveProperties(null);
  return "index.do";
}
origin: com.h2database/com.springsource.org.h2

synchronized ArrayList getSettings() {
  ArrayList settings = new ArrayList();
  if (connInfoMap.size() == 0) {
    Properties prop = loadProperties();
    if (prop.size() == 0) {
      for (int i = 0; i < GENERIC.length; i++) {
        ConnectionInfo info = new ConnectionInfo(GENERIC[i]);
        settings.add(info);
        updateSetting(info);
      }
    } else {
      for (int i = 0;; i++) {
        String data = prop.getProperty(String.valueOf(i));
        if (data == null) {
          break;
        }
        ConnectionInfo info = new ConnectionInfo(data);
        settings.add(info);
        updateSetting(info);
      }
    }
  } else {
    settings.addAll(connInfoMap.values());
  }
  sortConnectionInfo(settings);
  return settings;
}
origin: com.eventsourcing/h2

if (prop.size() == 0) {
  for (String gen : GENERIC) {
    ConnectionInfo info = new ConnectionInfo(gen);
    settings.add(info);
    updateSetting(info);
      break;
    ConnectionInfo info = new ConnectionInfo(data);
    settings.add(info);
    updateSetting(info);
origin: org.wowtools/h2

if (prop.size() == 0) {
  for (String gen : GENERIC) {
    ConnectionInfo info = new ConnectionInfo(gen);
    settings.add(info);
    updateSetting(info);
      break;
    ConnectionInfo info = new ConnectionInfo(data);
    settings.add(info);
    updateSetting(info);
origin: com.h2database/com.springsource.org.h2

ConnectionInfo info = new ConnectionInfo(data);
url = info.url;
user = info.user;
org.h2.server.webConnectionInfo

Javadoc

The connection info object is a wrapper for database connection information such as the database URL, user name and password. This class is used by the H2 Console.

Most used methods

  • <init>
  • get
  • getString

Popular in Java

  • Running tasks concurrently on multiple threads
  • notifyDataSetChanged (ArrayAdapter)
  • onRequestPermissionsResult (Fragment)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • HashSet (java.util)
    This class implements the Set interface, backed by a hash table (actually a HashMap instance). It m
  • Stack (java.util)
    The Stack class represents a last-in-first-out (LIFO) stack of objects. It extends class Vector with
  • ConcurrentHashMap (java.util.concurrent)
    A hash table supporting full concurrency of retrievals and adjustable expected concurrency for updat
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • JPanel (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now