public class DatabaseConfig extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_DATASOURCE_NAME
The name of the default JNDI datasource.
|
static String |
DEFAULT_DELEGATOR_NAME
The name of the default delegator.
|
Constructor and Description |
---|
DatabaseConfig(String databaseType,
String schemaName,
Datasource datasource)
Uses defaults for OfBiz Datasource name and Delegator name.
|
DatabaseConfig(String datasourceName,
String delegatorName,
String databaseType,
String schemaName,
Datasource datasource) |
Modifier and Type | Method and Description |
---|---|
String |
getDatabaseType()
Get the database type
|
Datasource |
getDatasource()
Get the datasource
|
org.ofbiz.core.entity.config.DatasourceInfo |
getDatasourceInfo() |
String |
getDatasourceName()
Get the name of the data source.
|
String |
getDelegatorName()
Get the name of the delegate.
|
String |
getDescriptorLabel() |
String |
getDescriptorValue() |
String |
getSchemaName()
Get the schema name
|
boolean |
isDatabaseEmpty(com.atlassian.config.bootstrap.AtlassianBootstrapManager bootstrapManager) |
boolean |
isEmbeddedDatabase()
Returns
true if this configuration is for an embedded HSQL or H2 database |
boolean |
isH2()
Returns
true if this configuration is for an H2 database |
boolean |
isHSql()
Deprecated.
since 7.0; only required during migration of 6.x HSQL installation to 7.x H2
|
boolean |
isMySql()
Returns
true if this configuration is for a MySQL database |
boolean |
isOracle()
Returns
true if this configuration is for an Oracle database |
boolean |
isPostgres()
Returns
true if this configuration is for a Postgres database |
boolean |
isSqlServer()
Returns
true if this configuration is for a SqlServer database |
FaultDescription |
testConnection(com.atlassian.config.bootstrap.AtlassianBootstrapManager bootstrapManager)
Tests the connection using the given bootstrapManager.
|
String |
toString() |
public static final String DEFAULT_DATASOURCE_NAME
public static final String DEFAULT_DELEGATOR_NAME
public DatabaseConfig(String databaseType, String schemaName, Datasource datasource)
databaseType
- the name that matches the field types defined in entityengine.xmlschemaName
- if the database needs it, the name of the schema. e.g. "public" is common in postgres.datasource
- the definition of the jdbc or jndi details.public DatabaseConfig(String datasourceName, String delegatorName, String databaseType, String schemaName, Datasource datasource)
public FaultDescription testConnection(com.atlassian.config.bootstrap.AtlassianBootstrapManager bootstrapManager) throws com.atlassian.config.bootstrap.BootstrapException
bootstrapManager
- to use for testing the connection.com.atlassian.config.bootstrap.BootstrapException
- on connection failure.public boolean isDatabaseEmpty(com.atlassian.config.bootstrap.AtlassianBootstrapManager bootstrapManager) throws com.atlassian.config.bootstrap.BootstrapException
com.atlassian.config.bootstrap.BootstrapException
public String getDatasourceName()
public String getDelegatorName()
public String getDatabaseType()
public boolean isH2()
true
if this configuration is for an H2 databasetrue
if this configuration is for an H2 databasepublic boolean isHSql()
true
if this configuration is for an HSql databasetrue
if this configuration is for an HSql databasepublic boolean isMySql()
true
if this configuration is for a MySQL databasetrue
if this configuration is for a MySQL databasepublic boolean isOracle()
true
if this configuration is for an Oracle databasetrue
if this configuration is for an Oracle databasepublic boolean isPostgres()
true
if this configuration is for a Postgres databasetrue
if this configuration is for a Postgres databasepublic boolean isSqlServer()
true
if this configuration is for a SqlServer databasetrue
if this configuration is for a SqlServer databasepublic boolean isEmbeddedDatabase()
true
if this configuration is for an embedded HSQL or H2 databasetrue
if this configuration is for an embedded HSQL or H2 databasepublic String getSchemaName()
public Datasource getDatasource()
public org.ofbiz.core.entity.config.DatasourceInfo getDatasourceInfo()
public String getDescriptorValue()
public String getDescriptorLabel()
Copyright © 2002-2017 Atlassian. All Rights Reserved.