public final class JdbcDatasource extends Object implements Datasource
JdbcDatasource.Builder
instead.
Several getters are also deprecated because the same data
can be obtained indirectly through getConnectionPoolInfo()
.Modifier and Type | Class and Description |
---|---|
static class |
JdbcDatasource.Builder
This is a builder class for constructing a JdbcDatasource manually.
|
Constructor and Description |
---|
JdbcDatasource(DatabaseType databaseType,
String hostname,
String port,
String instance,
String username,
String password,
Integer poolMaxSize,
String validationQuery,
Long minEvictableTimeMillis,
Long timeBetweenEvictionRunsMillis)
Deprecated.
|
JdbcDatasource(org.ofbiz.core.entity.config.JdbcDatasourceInfo jdbc) |
JdbcDatasource(String jdbcUrl,
String driverClassName,
String username,
String password,
int poolMaxSize,
String validationQuery,
Long minEvictableTimeMillis,
Long timeBetweenEvictionRunsMillis)
Deprecated.
|
JdbcDatasource(String jdbcUrl,
String driverClassName,
String username,
String password,
Properties connectionProperties,
int poolMaxSize,
String validationQuery,
Long minEvictableTimeMillis,
Long timeBetweenEvictionRunsMillis)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static JdbcDatasource.Builder |
builder()
Factory method to create a new
JdbcDatasource.Builder for constructing a
JdbcDatasource using a chain of named setters rather than a
long list of parameters in a specific order. |
boolean |
equals(Object o) |
Connection |
getConnection(com.atlassian.config.bootstrap.AtlassianBootstrapManager bootstrapManager)
Uses the given
link AtlassianBootstrapManager to acquire a Connection to the database defined by
this Datasource . |
org.ofbiz.core.entity.config.ConnectionPoolInfo |
getConnectionPoolInfo() |
Properties |
getConnectionProperties() |
org.ofbiz.core.entity.config.DatasourceInfo |
getDatasource(String datasourceName,
String fieldType,
String schemaName)
Get the equivalent Ofbiz DatasourceInfo config class for this Datasource.
|
String |
getDescriptorLabel()
Provides the name of the datasource field that this datasource represents.
|
String |
getDescriptorValue(String databaseType)
Provides a text description suitable for an administrator that identifies the datasource.
|
String |
getDriverClassName()
The class name for the driver
|
String |
getJdbcUrl()
The JDBC URL
|
Long |
getMinEvictableTimeMillis()
Deprecated.
|
String |
getPassword()
The password for the database connection
|
int |
getPoolSize()
Deprecated.
|
Long |
getTimeBetweenEvictionRunsMillis()
Deprecated.
|
String |
getUsername()
The username for the database connection
|
String |
getValidationQuery()
Deprecated.
|
int |
hashCode() |
static void |
registerDriver(String className) |
static void |
setRegisterDriverOnConstruct(boolean registerDriverOnConstruct)
This setting is soley so the config tool can avoid the fatal side-effect of registering the JDBC driver in this
class's constructor.
|
JdbcDatasource.Builder |
toBuilder() |
String |
toString() |
void |
writeTo(org.dom4j.Element element)
Serializes this JDBC to an XML element.
|
@Deprecated public JdbcDatasource(String jdbcUrl, String driverClassName, String username, String password, int poolMaxSize, String validationQuery, Long minEvictableTimeMillis, Long timeBetweenEvictionRunsMillis)
@Deprecated public JdbcDatasource(String jdbcUrl, String driverClassName, String username, String password, Properties connectionProperties, int poolMaxSize, String validationQuery, Long minEvictableTimeMillis, Long timeBetweenEvictionRunsMillis)
@Deprecated public JdbcDatasource(DatabaseType databaseType, String hostname, String port, String instance, String username, String password, Integer poolMaxSize, String validationQuery, Long minEvictableTimeMillis, Long timeBetweenEvictionRunsMillis)
public JdbcDatasource(org.ofbiz.core.entity.config.JdbcDatasourceInfo jdbc)
public static void setRegisterDriverOnConstruct(boolean registerDriverOnConstruct)
registerDriverOnConstruct
- If true we do "Class.forName(driverClassName);" in the Constructor.public static void registerDriver(String className)
public static JdbcDatasource.Builder builder()
JdbcDatasource.Builder
for constructing a
JdbcDatasource using a chain of named setters rather than a
long list of parameters in a specific order.JdbcDatasource.Builder
public JdbcDatasource.Builder toBuilder()
public Connection getConnection(com.atlassian.config.bootstrap.AtlassianBootstrapManager bootstrapManager) throws com.atlassian.config.bootstrap.BootstrapException
Datasource
link AtlassianBootstrapManager
to acquire a Connection
to the database defined by
this Datasource
.getConnection
in interface Datasource
bootstrapManager
- the bootstrapManager to use to get the connection.com.atlassian.config.bootstrap.BootstrapException
- if the connection cannot be established.public org.ofbiz.core.entity.config.DatasourceInfo getDatasource(String datasourceName, String fieldType, String schemaName)
Datasource
getDatasource
in interface Datasource
datasourceName
- the ofbiz name of the datasource.fieldType
- the field-type for the datasource as defined in ofbiz field-types.xmlschemaName
- the name of the schema for the database (may be empty)DatasourceInfo
suitable for configuring Ofbiz.public String getDescriptorValue(String databaseType)
Datasource
getDescriptorValue
in interface Datasource
databaseType
- the field-type for the datasource as defined in ofbiz field-types.xmlpublic String getDescriptorLabel()
Datasource
getDescriptorLabel
in interface Datasource
public String getJdbcUrl()
public String getDriverClassName()
public String getUsername()
public String getPassword()
public Properties getConnectionProperties()
public org.ofbiz.core.entity.config.ConnectionPoolInfo getConnectionPoolInfo()
@Deprecated public int getPoolSize()
@Deprecated public String getValidationQuery()
@Deprecated public Long getMinEvictableTimeMillis()
@Deprecated public Long getTimeBetweenEvictionRunsMillis()
public void writeTo(org.dom4j.Element element)
element
- the parent element within which to write the JDBC Datasource.Copyright © 2002-2019 Atlassian. All Rights Reserved.