|
Arch4J 1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.arch4j.dataaccess.DataAccessProvider
This class is the main service provider for data access services.
The services are accessed via the static getProvider()
method.
Constructor Summary | |
protected |
DataAccessProvider()
|
Method Summary | |
DatabaseManager |
getDefaultManager()
Create a DatabaseManager for data access. |
TransactionalDatabaseManager |
getDefaultTransactionalManager()
Create a TransactionalDatabaseManager for data access. |
DatabaseManager |
getManagerFor(String logicalName)
Create a DatabaseManager for data access. |
DatabaseManager |
getManagerFor(String logicalName,
String dataSourceLookupName)
|
DatabaseManager |
getManagerFor(String logicalName,
String username,
String password)
Deprecated. Use other getDefaultManager constructor. |
static DataAccessProvider |
getProvider()
|
TransactionalDatabaseManager |
getTransactionalManagerFor(String logicalName)
Create a TransactionalDatabaseManager for data access. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected DataAccessProvider()
Method Detail |
public static DataAccessProvider getProvider()
public DatabaseManager getDefaultManager() throws DataAccessException
DatabaseManager
for data access. The logical
database name to use is specified as the default connection
property in the dataaccess.properties file.
Note: The property keys for the default connection is:
defaultConnection
DatabaseManager
instance to use for data access.
DataAccessException
- Thrown when there is a problem accessing the database.public DatabaseManager getManagerFor(String logicalName) throws DataAccessException
DatabaseManager
for data access. The connection can be
retreived from the Driver Manager and from a datasource.
Map the given logical name for the database to the physical connection
specification by looking in the dataaccess.properties file.
Note: The property keys used for the connection specification are summarized below. For example, if the logical name is myDatabase, the property keys used are:
These are the properties required for getting a connection from a DrivermyDatabase.driver myDatabase.url myDatabase.username myDatabase.password myDatabase.useArch4JPoolThe useArch4JPool is required to be set to true only if you want to use the connection pooling implementation of Arch4J. Is you are using a connection pool in a appserver world and the pooling is implemented by the driver then useArch4JPool is not required
These are the properties required for getting a connection from a DatasourceuseArch4JPool is not required if you are not requiring the connection pooling implementation of Arch4J.myDatabase.dataSourceLookupName myDatabase.useArch4JPool
logicalName
- The name to use for the connection mapping.
DatabaseManager
instance to use for data access.
DataAccessException
public DatabaseManager getManagerFor(String logicalName, String username, String password) throws DataAccessException
DatabaseManager
for data access. Map the
given logical name for the database to the physical connection
specification by looking in the dataaccess.properties file.
Note: The property keys used for the connection specification are summarized below. For example, if the logical name is myDatabase, the property keys used are:
The useArch4JPool is required to be set to true only if you want to use the connection pooling implementation of Arch4J. Is you are using a connection pool in a appserver world and the pooling is implemented by the driver then useArch4JPool is not requiredmyDatabase.driver myDatabase.url myDatabase.useArch4JPool
logicalName
- The name to use for the connection mapping.username
- The database user on whose behalf the connection is being made.password
- The user's password.
DatabaseManager
instance to use for data access.
DataAccessException
- Thrown when there is a problem accessing the database.public DatabaseManager getManagerFor(String logicalName, String dataSourceLookupName) throws DataAccessException
DataAccessException
public TransactionalDatabaseManager getDefaultTransactionalManager() throws DataAccessException
TransactionalDatabaseManager
for data access.
Each instance is a singleton within the thread it is requested by.
The logical database name to use is specified as the default connection
property in the dataaccess.properties file.
Note: The property keys for the default connection is:
defaultConnection
DatabaseManager
instance to use for data access.
DataAccessException
- Thrown when there is a problem accessing the database.public TransactionalDatabaseManager getTransactionalManagerFor(String logicalName) throws DataAccessException
TransactionalDatabaseManager
for data access.
Each calling into instances of this class can orchestrate a transaction. This
allows for seperate transactions within a multi-threaded environment
such as a Servlet engine.
The connection can be retreived from the Driver Manager and from a datasource.
Map the given logical name for the database to the physical connection
specification by looking in the dataaccess.properties file.
Note: The property keys used for the connection specification are summarized below. For example, if the logical name is myDatabase, the property keys used are:
These are the properties required for getting a connection from a DrivermyDatabase.driver myDatabase.url myDatabase.username myDatabase.password myDatabase.useArch4JPoolThe useArch4JPool is required to be set to true only if you want to use the connection pooling implementation of Arch4J. Is you are using a connection pool in a appserver world and the pooling is implemented by the driver then useArch4JPool is not required
These are the properties required for getting a connection from a DatasourceuseArch4JPool is not required if you are not requiring the connection pooling implementation of Arch4J.myDatabase.dataSourceLookupName myDatabase.useArch4JPool
logicalName
- The name to use for the connection mapping.
DatabaseManager
instance to use for data access.
DataAccessException
|
Arch4J 1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |