public static class JdbcDatasource.Builder extends Object
JdbcDatasource.builder()
factory to obtain an instance
of this class and call the various setXyzzy methods to
populate the fields. Those that are left unset or are explicitly
set to null will use their default values.Constructor and Description |
---|
Builder() |
public JdbcDatasource build()
IllegalArgumentException
- if the configuration is invalid, such as
if the username is left unspecified or if neither the JDBC URL nor
a database type is given.InvalidDatabaseDriverException
- if the database driver is invalidpublic DatabaseType getDatabaseType()
public JdbcDatasource.Builder setDatabaseType(DatabaseType databaseType)
JDBC URL
is explicitly set. One or the other means of setting the URL is
required.databaseType
- the database type for the JDBC URLsetJdbcUrl(String)
public String getHostname()
public JdbcDatasource.Builder setHostname(String hostname)
hostname
- the hostname for the JDBC URLsetDatabaseType(DatabaseType)
,
setJdbcUrl(String)
public String getPort()
public JdbcDatasource.Builder setPort(String port)
port
- the port for the JDBC URLsetDatabaseType(DatabaseType)
,
setJdbcUrl(String)
public String getInstance()
public JdbcDatasource.Builder setInstance(String instance)
instance
- the instance for the JDBC URLsetDatabaseType(DatabaseType)
,
setJdbcUrl(String)
public String getJdbcUrl()
public JdbcDatasource.Builder setJdbcUrl(String jdbcUrl)
driver class name
will
be required.jdbcUrl
- the complete JDBC URL to usesetDatabaseType(DatabaseType)
,
setDriverClassName(String)
public String getDriverClassName()
public JdbcDatasource.Builder setDriverClassName(String driverClassName)
JDBC URL
is explicitly set. Otherwise, it is ignored.driverClassName
- the class name of the JDBC driver to usepublic String getUsername()
public JdbcDatasource.Builder setUsername(String username)
public String getPassword()
public JdbcDatasource.Builder setPassword(String password)
public Properties getConnectionProperties()
public JdbcDatasource.Builder setConnectionProperties(Properties connectionProperties)
public org.ofbiz.core.entity.config.ConnectionPoolInfo getConnectionPoolInfo()
public JdbcDatasource.Builder setConnectionPoolInfo(org.ofbiz.core.entity.config.ConnectionPoolInfo connectionPoolInfo)
Copyright © 2002-2015 Atlassian. All Rights Reserved.