Package org.kie.test.util.db.internal
Class PoolingDataSourceWrapperImpl
java.lang.Object
org.kie.test.util.db.internal.PoolingDataSourceWrapperImpl
- All Implemented Interfaces:
Wrapper,CommonDataSource,DataSource,PoolingDataSourceWrapper
Wrapper for actual Pooling Data Source provided by tomcat DBCP library. This class offers data source with
XA transactions and connection pooling capabilities.
-
Constructor Summary
ConstructorsConstructorDescriptionPoolingDataSourceWrapperImpl(String uniqueName, String dsClassName, Properties driverProperties) This constructor creates a PoolingDataSource using internallyBasicManagedDataSourcewith its default pooling parameters.PoolingDataSourceWrapperImpl(String uniqueName, String dsClassName, Properties driverProperties, Properties poolingProperties) This constructor creates a PoolingDataSource using internallyBasicManagedDataSource. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the data source; as a result, the data source will stop providing connections and will be unregistered from JNDI context.getConnection(String username, String password) intbooleanisWrapperFor(Class<?> iface) voidsetLoginTimeout(int seconds) voidsetLogWriter(PrintWriter out) <T> TMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.sql.CommonDataSource
createShardingKeyBuilderMethods inherited from interface javax.sql.DataSource
createConnectionBuilder
-
Constructor Details
-
PoolingDataSourceWrapperImpl
public PoolingDataSourceWrapperImpl(String uniqueName, String dsClassName, Properties driverProperties) This constructor creates a PoolingDataSource using internallyBasicManagedDataSourcewith its default pooling parameters.- Parameters:
uniqueName- Data Source unique name. Serves for registration to JNDI.dsClassName- Name of a class implementingXADataSourceavailable in a JDBC driver on a classpath.driverProperties- Properties of a database driver.
-
PoolingDataSourceWrapperImpl
public PoolingDataSourceWrapperImpl(String uniqueName, String dsClassName, Properties driverProperties, Properties poolingProperties) This constructor creates a PoolingDataSource using internallyBasicManagedDataSource.- Parameters:
uniqueName- Data Source unique name. Serves for registration to JNDI.dsClassName- Name of a class implementingXADataSourceavailable in a JDBC driver on a classpath.driverProperties- Properties of a database driver.poolingProperties- Properties of a pooling data source. SeeBasicManagedDataSourcefor details.
-
-
Method Details
-
close
public void close()Description copied from interface:PoolingDataSourceWrapperCloses the data source; as a result, the data source will stop providing connections and will be unregistered from JNDI context.- Specified by:
closein interfacePoolingDataSourceWrapper
-
getUniqueName
- Specified by:
getUniqueNamein interfacePoolingDataSourceWrapper- Returns:
- the data source JNDI name
-
getClassName
- Specified by:
getClassNamein interfacePoolingDataSourceWrapper- Returns:
- name of underlying XADataSource class
-
getConnection
- Specified by:
getConnectionin interfaceDataSource- Throws:
SQLException
-
getConnection
- Specified by:
getConnectionin interfaceDataSource- Throws:
SQLException
-
unwrap
- Specified by:
unwrapin interfaceWrapper- Throws:
SQLException
-
isWrapperFor
- Specified by:
isWrapperForin interfaceWrapper- Throws:
SQLException
-
getLogWriter
- Specified by:
getLogWriterin interfaceCommonDataSource- Specified by:
getLogWriterin interfaceDataSource- Throws:
SQLException
-
setLogWriter
- Specified by:
setLogWriterin interfaceCommonDataSource- Specified by:
setLogWriterin interfaceDataSource- Throws:
SQLException
-
setLoginTimeout
- Specified by:
setLoginTimeoutin interfaceCommonDataSource- Specified by:
setLoginTimeoutin interfaceDataSource- Throws:
SQLException
-
getLoginTimeout
- Specified by:
getLoginTimeoutin interfaceCommonDataSource- Specified by:
getLoginTimeoutin interfaceDataSource- Throws:
SQLException
-
getParentLogger
- Specified by:
getParentLoggerin interfaceCommonDataSource- Throws:
SQLFeatureNotSupportedException
-