org.jboss.jca.adapters.jdbc
Class WrapperDataSource

java.lang.Object
  extended by org.jboss.jca.adapters.jdbc.JBossWrapper
      extended by org.jboss.jca.adapters.jdbc.WrapperDataSource
All Implemented Interfaces:
Serializable, Wrapper, 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

Constructor Summary
protected WrapperDataSource(BaseWrapperManagedConnectionFactory mcf, javax.resource.spi.ConnectionManager cm)
          Constructor
 
Method Summary
protected  void checkTransactionActive()
          Check whether a tranasction is active
 Connection getConnection()
          
 Connection getConnection(String user, String password)
          
 int getLoginTimeout()
          
 PrintWriter getLogWriter()
          
 Logger getParentLogger()
          
 Reference getReference()
          
protected  int getTimeLeftBeforeTransactionTimeout()
          Get the time left before a transaction timeout
 void setLoginTimeout(int param1)
          
 void setLogWriter(PrintWriter pw)
          
 void setReference(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 java.sql.Wrapper
isWrapperFor, unwrap
 

Constructor Detail

WrapperDataSource

protected WrapperDataSource(BaseWrapperManagedConnectionFactory mcf,
                            javax.resource.spi.ConnectionManager cm)
Constructor

Parameters:
mcf - The managed connection factory
cm - The connection manager
Method Detail

getLogWriter

public PrintWriter getLogWriter()
                         throws SQLException

Specified by:
getLogWriter in interface CommonDataSource
Throws:
SQLException

setLogWriter

public void setLogWriter(PrintWriter pw)
                  throws SQLException

Specified by:
setLogWriter in interface CommonDataSource
Throws:
SQLException

getLoginTimeout

public int getLoginTimeout()
                    throws SQLException

Specified by:
getLoginTimeout in interface CommonDataSource
Throws:
SQLException

setLoginTimeout

public void setLoginTimeout(int param1)
                     throws SQLException

Specified by:
setLoginTimeout in interface CommonDataSource
Throws:
SQLException

getParentLogger

public Logger getParentLogger()
                       throws SQLFeatureNotSupportedException

Throws:
SQLFeatureNotSupportedException

getConnection

public Connection getConnection()
                         throws SQLException

Specified by:
getConnection in interface DataSource
Throws:
SQLException

getConnection

public Connection getConnection(String user,
                                String password)
                         throws SQLException

Specified by:
getConnection in interface DataSource
Throws:
SQLException

setReference

public void setReference(Reference reference)


getReference

public Reference getReference()

Specified by:
getReference in interface Referenceable

getTimeLeftBeforeTransactionTimeout

protected int getTimeLeftBeforeTransactionTimeout()
                                           throws SQLException
Get the time left before a transaction timeout

Returns:
The amount in seconds; -1 if no timeout
Throws:
SQLException - Thrown if an error occurs

checkTransactionActive

protected void checkTransactionActive()
                               throws SQLException
Check 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


Copyright © 2012 JBoss, by Red Hat (http://www.jboss.org/ironjacamar)