Package org.jboss.jca.adapters.jdbc
Class WrapperDataSource
- java.lang.Object
-
- org.jboss.jca.adapters.jdbc.JBossWrapper
-
- org.jboss.jca.adapters.jdbc.WrapperDataSource
-
- All Implemented Interfaces:
Serializable,Wrapper,Referenceable,javax.resource.Referenceable,CommonDataSource,DataSource
public class WrapperDataSource extends JBossWrapper implements javax.resource.Referenceable, DataSource, Serializable
WrapperDataSource- Version:
- $Revision: 71788 $
- Author:
- David Jencks, Adrian Brock, Jesper Pedersen
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.jboss.jca.adapters.jdbc.JBossWrapper
bundle
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedWrapperDataSource(BaseWrapperManagedConnectionFactory mcf, javax.resource.spi.ConnectionManager cm, ClassLoaderPlugin classLoaderPlugin)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckTransactionActive()Check whether a tranasction is activeConnectiongetConnection()ConnectiongetConnection(String user, String password)intgetLoginTimeout()PrintWritergetLogWriter()LoggergetParentLogger()ReferencegetReference()protected intgetTimeLeftBeforeTransactionTimeout()Get the time left before a transaction timeoutvoidsetLoginTimeout(int param1)voidsetLogWriter(PrintWriter pw)voidsetReference(Reference reference)-
Methods inherited from class org.jboss.jca.adapters.jdbc.JBossWrapper
getWrappedObject, isWrapperFor, unwrap
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.sql.CommonDataSource
createShardingKeyBuilder
-
Methods inherited from interface javax.sql.DataSource
createConnectionBuilder
-
Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
-
-
-
-
Constructor Detail
-
WrapperDataSource
protected WrapperDataSource(BaseWrapperManagedConnectionFactory mcf, javax.resource.spi.ConnectionManager cm, ClassLoaderPlugin classLoaderPlugin)
Constructor- Parameters:
mcf- The managed connection factorycm- The connection manager
-
-
Method Detail
-
getLogWriter
public PrintWriter getLogWriter() throws SQLException
- Specified by:
getLogWriterin interfaceCommonDataSource- Specified by:
getLogWriterin interfaceDataSource- Throws:
SQLException
-
setLogWriter
public void setLogWriter(PrintWriter pw) throws SQLException
- Specified by:
setLogWriterin interfaceCommonDataSource- Specified by:
setLogWriterin interfaceDataSource- Throws:
SQLException
-
getLoginTimeout
public int getLoginTimeout() throws SQLException- Specified by:
getLoginTimeoutin interfaceCommonDataSource- Specified by:
getLoginTimeoutin interfaceDataSource- Throws:
SQLException
-
setLoginTimeout
public void setLoginTimeout(int param1) throws SQLException- Specified by:
setLoginTimeoutin interfaceCommonDataSource- Specified by:
setLoginTimeoutin interfaceDataSource- Throws:
SQLException
-
getParentLogger
public Logger getParentLogger() throws SQLFeatureNotSupportedException
- Specified by:
getParentLoggerin interfaceCommonDataSource- Throws:
SQLFeatureNotSupportedException
-
getConnection
public Connection getConnection() throws SQLException
- Specified by:
getConnectionin interfaceDataSource- Throws:
SQLException
-
getConnection
public Connection getConnection(String user, String password) throws SQLException
- Specified by:
getConnectionin interfaceDataSource- Throws:
SQLException
-
setReference
public void setReference(Reference reference)
- Specified by:
setReferencein interfacejavax.resource.Referenceable
-
getReference
public Reference getReference()
- Specified by:
getReferencein interfaceReferenceable
-
getTimeLeftBeforeTransactionTimeout
protected int getTimeLeftBeforeTransactionTimeout() throws SQLExceptionGet the time left before a transaction timeout- Returns:
- The amount in seconds;
-1if no timeout - Throws:
SQLException- Thrown if an error occurs
-
checkTransactionActive
protected void checkTransactionActive() throws SQLExceptionCheck whether a tranasction is active- Throws:
SQLException- if the transaction is not active, preparing, prepared or committing or for any error in the transaction manager
-
-