Search in sources :

Example 1 with ConfigSection

use of com.google.gerrit.server.config.ConfigSection in project gerrit by GerritCodeReview.

the class DB2 method getUrl.

@Override
public String getUrl() {
    final StringBuilder b = new StringBuilder();
    final ConfigSection dbc = new ConfigSection(cfg, "database");
    b.append("jdbc:db2://");
    b.append(hostname(dbc.optional("hostname")));
    b.append(port(dbc.optional("port")));
    b.append("/");
    b.append(dbc.required("database"));
    return b.toString();
}
Also used : ConfigSection(com.google.gerrit.server.config.ConfigSection)

Example 2 with ConfigSection

use of com.google.gerrit.server.config.ConfigSection in project gerrit by GerritCodeReview.

the class HANA method getUrl.

@Override
public String getUrl() {
    final StringBuilder b = new StringBuilder();
    final ConfigSection dbs = new ConfigSection(cfg, "database");
    b.append("jdbc:sap://");
    b.append(hostname(dbs.required("hostname")));
    int instance = Integer.parseInt(dbs.required("instance"));
    String port = "3" + String.format("%02d", instance) + "15";
    b.append(port(port));
    return b.toString();
}
Also used : ConfigSection(com.google.gerrit.server.config.ConfigSection)

Example 3 with ConfigSection

use of com.google.gerrit.server.config.ConfigSection in project gerrit by GerritCodeReview.

the class Oracle method getUrl.

@Override
public String getUrl() {
    final StringBuilder b = new StringBuilder();
    final ConfigSection dbc = new ConfigSection(cfg, "database");
    b.append("jdbc:oracle:thin:@");
    b.append(hostname(dbc.optional("hostname")));
    b.append(port(dbc.optional("port")));
    b.append(":");
    b.append(dbc.required("instance"));
    return b.toString();
}
Also used : ConfigSection(com.google.gerrit.server.config.ConfigSection)

Example 4 with ConfigSection

use of com.google.gerrit.server.config.ConfigSection in project gerrit by GerritCodeReview.

the class PostgreSQL method getUrl.

@Override
public String getUrl() {
    final StringBuilder b = new StringBuilder();
    final ConfigSection dbc = new ConfigSection(cfg, "database");
    b.append("jdbc:postgresql://");
    b.append(hostname(dbc.optional("hostname")));
    b.append(port(dbc.optional("port")));
    b.append("/");
    b.append(dbc.required("database"));
    return b.toString();
}
Also used : ConfigSection(com.google.gerrit.server.config.ConfigSection)

Example 5 with ConfigSection

use of com.google.gerrit.server.config.ConfigSection in project gerrit by GerritCodeReview.

the class MariaDb method getUrl.

@Override
public String getUrl() {
    StringBuilder b = new StringBuilder();
    ConfigSection dbs = new ConfigSection(cfg, "database");
    b.append("jdbc:mariadb://");
    b.append(hostname(dbs.optional("hostname")));
    b.append(port(dbs.optional("port")));
    b.append("/");
    b.append(dbs.required("database"));
    return b.toString();
}
Also used : ConfigSection(com.google.gerrit.server.config.ConfigSection)

Aggregations

ConfigSection (com.google.gerrit.server.config.ConfigSection)8 SimpleDataSource (com.google.gwtorm.jdbc.SimpleDataSource)1 ProvisionException (com.google.inject.ProvisionException)1 SQLException (java.sql.SQLException)1 Properties (java.util.Properties)1 BasicDataSource (org.apache.commons.dbcp.BasicDataSource)1