PGPoolingDataSource.setDatabaseName
Code IndexAdd Codota to your IDE (free)

Best Java code snippets using org.postgresql.ds.PGPoolingDataSource.setDatabaseName (Showing top 6 results out of 315)

  • Common ways to obtain PGPoolingDataSource
private void myMethod () {
PGPoolingDataSource p =
  • new PGPoolingDataSource()
  • String name;PGPoolingDataSource.getDataSource(name)
  • Map map;Object key;(PGPoolingDataSource) map.get(key)
  • Smart code suggestions by Codota
}
origin: orbisgis/h2gis

@Override
public DataSource createDataSource(Properties properties) throws SQLException {
  if (properties == null) {
    properties = new Properties();
  }
  if(properties.getProperty(JDBC_DATASOURCE_NAME) == null) {
    properties.setProperty(JDBC_DATASOURCE_NAME, DataSourceFactoryImpl.class.getSimpleName() + "_" +
        dataSourceCount.getAndAdd(1));
  }
  PGPoolingDataSource dataSource = PGPoolingDataSource.getDataSource(properties.getProperty(JDBC_DATASOURCE_NAME));
  if(dataSource == null) {
    dataSource = new PGPoolingDataSource();
    // Set dataSourceName, databaseName, user, and password
    dataSource.setDataSourceName(properties.getProperty(JDBC_DATASOURCE_NAME));
    String url = properties.getProperty(JDBC_URL);
    if(url != null) {
      dataSource.setUrl(url);
    }
    dataSource.setPortNumber(Integer.valueOf(properties.getProperty(JDBC_PORT_NUMBER, Integer.toString(dataSource.getPortNumber()))));
    dataSource.setServerName(properties.getProperty(JDBC_SERVER_NAME, dataSource.getServerName()));
    dataSource.setUser(properties.getProperty(JDBC_USER, dataSource.getUser()));
    dataSource.setPassword(properties.getProperty(JDBC_PASSWORD, dataSource.getPassword()));
    dataSource.setDatabaseName(properties.getProperty(JDBC_DATABASE_NAME, dataSource.getDatabaseName()));
  }
  return new DataSourceWrapper(dataSource);
}
origin: orbisgis/orbisgis

@Override
public DataSource createDataSource(Properties properties) throws SQLException {
  if (properties == null) {
    properties = new Properties();
  }
  if(properties.getProperty(JDBC_DATASOURCE_NAME) == null) {
    properties.setProperty(JDBC_DATASOURCE_NAME, DataSourceFactoryImpl.class.getSimpleName() + "_" +
        dataSourceCount.getAndAdd(1));
  }
  PGPoolingDataSource dataSource = PGPoolingDataSource.getDataSource(properties.getProperty(JDBC_DATASOURCE_NAME));
  if(dataSource == null) {
    dataSource = new PGPoolingDataSource();
    // Set dataSourceName, databaseName, user, and password
    dataSource.setDataSourceName(properties.getProperty(JDBC_DATASOURCE_NAME));
    String url = properties.getProperty(JDBC_URL);
    if(url != null) {
      dataSource.setUrl(url);
    }
    dataSource.setPortNumber(Integer.valueOf(properties.getProperty(JDBC_PORT_NUMBER, Integer.toString(dataSource.getPortNumber()))));
    dataSource.setServerName(properties.getProperty(JDBC_SERVER_NAME, dataSource.getServerName()));
    dataSource.setUser(properties.getProperty(JDBC_USER, dataSource.getUser()));
    dataSource.setPassword(properties.getProperty(JDBC_PASSWORD, dataSource.getPassword()));
    dataSource.setDatabaseName(properties.getProperty(JDBC_DATABASE_NAME, dataSource.getDatabaseName()));
  }
  return new DataSourceWrapper(dataSource);
}
origin: org.orbisgis/postgis-jts-osgi

@Override
public DataSource createDataSource(Properties properties) throws SQLException {
  if (properties == null) {
    properties = new Properties();
  }
  PGPoolingDataSource dataSource = new PGPoolingDataSource();
  // Set dataSourceName, databaseName, user, and password
  dataSource.setDataSourceName(properties.getProperty(JDBC_DATASOURCE_NAME));
  String url = properties.getProperty(JDBC_URL);
  if(url != null) {
    dataSource.setUrl(url);
  }
  dataSource.setPortNumber(Integer.valueOf(properties.getProperty(JDBC_PORT_NUMBER, Integer.toString(dataSource.getPortNumber()))));
  dataSource.setServerName(properties.getProperty(JDBC_SERVER_NAME, dataSource.getServerName()));
  dataSource.setUser(properties.getProperty(JDBC_USER, dataSource.getUser()));
  dataSource.setPassword(properties.getProperty(JDBC_PASSWORD, dataSource.getPassword()));
  dataSource.setDatabaseName(properties.getProperty(JDBC_DATABASE_NAME, dataSource.getDatabaseName()));
  return new DataSourceWrapper(dataSource);
}
origin: org.mil-oss/fgsms-common-test-utils

ds.setServerName((String) db.get("perf_servername"));
ds.setPortNumber(Integer.parseInt((String) db.get("perf_port")));
ds.setDatabaseName((String) db.get("perf_db"));
ds.setUser((String) db.get("perf_user"));
ds.setPassword((String) db.get("perf_password"));
ds.setServerName((String) db.get("config_servername"));
ds.setPortNumber(Integer.parseInt((String) db.get("config_port")));
ds.setDatabaseName((String) db.get("config_db"));
ds.setUser((String) db.get("config_user"));
ds.setPassword((String) db.get("config_password"));
origin: io.jeo/jeo-postgis

static PGPoolingDataSource createDataSource(PostGISOpts pgopts) {
  PGPoolingDataSource dataSource = new PGPoolingDataSource();
  dataSource.setServerName(pgopts.host());
  dataSource.setDatabaseName(pgopts.db());
  dataSource.setPortNumber(pgopts.port());
  dataSource.setUser(pgopts.user());
  if (pgopts.passwd() != null) {
    dataSource.setPassword(Password.toString(pgopts.passwd()));
  }
  return dataSource;
}
origin: liveoak-io/liveoak

nu.setServerName(server);
nu.setPortNumber(port);
nu.setDatabaseName(dbName);
nu.setUser(user);
nu.setPassword(pass);
org.postgresql.dsPGPoolingDataSourcesetDatabaseName

Javadoc

Ensures the DataSource properties are not changed after the DataSource has been used.

Popular methods of PGPoolingDataSource

  • <init>
  • setInitialConnections
    Sets the number of connections that will be created when this DataSource is initialized. If you do n
  • setMaxConnections
    Sets the maximum number of connections that the pool will allow. If a request comes in and this many
  • close
    Closes this DataSource, and all the pooled connections, whether in use or not.
  • getDataSource
  • setDataSourceName
    Sets the name of this DataSource. This is required, and uniquely identifies the DataSource. You cann
  • setPassword
    Ensures the DataSource properties are not changed after the DataSource has been used.
  • setUser
    Ensures the DataSource properties are not changed after the DataSource has been used.
  • getServerName
  • setPortNumber
    Ensures the DataSource properties are not changed after the DataSource has been used.
  • setServerName
    Ensures the DataSource properties are not changed after the DataSource has been used.
  • getConnection
    Gets a non-pooled connection, unless the user and password are the same as the default values for th
  • setServerName,
  • getConnection,
  • getDatabaseName,
  • getPassword,
  • getPortNumber,
  • getUser,
  • getMaxConnections,
  • initialize,
  • setUrl

Popular in Java

  • Start an intent from android
  • getSupportFragmentManager (FragmentActivity)
  • getApplicationContext (Context)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • Menu (java.awt)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Reference (javax.naming)

For IntelliJ IDEA,
Android Studio or Eclipse

  • Search for JavaScript code betaCodota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutBlogContact Us
  • Plugin user guideTerms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)