public class DataSourceProvider extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
activeUserManagedTransaction()
Verifies, whether an explicit (user managed) transaction is currently in progress, i.e., the application
has explicitly issued a "begin", but has not yet terminated the transaction with "commit" or "rollback".
|
static void |
addDataSource(DataSource pDataSource,
String pDataSourceName,
boolean pActivate)
Adds and optionally activates a new data source to be controlled by the DataSourceProvider.
|
static void |
begin()
To control transactions in the calling application, the connection in use must not
turned back to the connection pool, but should be preserved in a ThreadLocal variable.
|
static void |
commit()
Commits a user managed transaction.
|
static int |
getBatchUpdateSize()
Returns the currently size of JDBC update and insert batches.
|
static oracle.jdbc.OracleConnection |
getConnection()
Returns the Oracle database connection currently managed by the DataSourceProvider.
|
boolean |
isDebugOn()
Shows whether debug mode has been enabled.
|
static void |
rollback()
Issues a rollback on a user managed transaction.
|
static void |
setActiveDataSource(String pDataSourceName)
Activates the data source with the given name.
|
static void |
setBatchUpdateSize(int pBatchUpdateSize)
Sets the size of JDBC update and insert batches.
|
static void |
setDebugMode(boolean pDebugMode)
Debug mode is enabled by establishing a JPDA/JDWP connection to a listening source code debugger,
which listens on the configured host and port for database session debugging.
|
public static void setActiveDataSource(String pDataSourceName)
pDataSourceName - the name of the data source to be activated.public static void addDataSource(DataSource pDataSource, String pDataSourceName, boolean pActivate)
pDataSource - the pre-configured data source.pDataSourceName - the name of the data source. Used by method setActiveDataSource.pActivate - determines, whether the data source should be activated right after it has been added.public static oracle.jdbc.OracleConnection getConnection()
throws SQLException
SQLExceptionpublic static boolean activeUserManagedTransaction()
public static void begin()
public static void commit()
public static void rollback()
public static int getBatchUpdateSize()
public static void setBatchUpdateSize(int pBatchUpdateSize)
pBatchUpdateSize - public boolean isDebugOn()
public static void setDebugMode(boolean pDebugMode)
pDebugMode - debug mode toggle.Copyright © 2013. All rights reserved.