Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.atomikos.jdbc
Class JtaDataSourceImp

    java.lang.Object
      com.atomikos.jdbc.JtaDataSourceImp

All Implemented Interfaces:
  HeuristicDataSource, EventListener, Referenceable, ConnectionEventListener, ConnectionPoolDataSource, DataSource

Deprecated. As of release 3.3, the `AtomikosDataSourceBean` should be used instead.

    public class JtaDataSourceImp

extends Object
implements HeuristicDataSource, ConnectionEventListener, Referenceable, ConnectionPoolDataSource

A basic datasource implementation that works with Atomikos connection pools and supports heuristic messages. Instances are referenceable in JNDI, but not Serializable.

Note: instead of using this class directly, it is highly recommended that you use one of the other Atomikos DataSourceBean implementations instead.

Constructor Summary
`JtaDataSourceImp(XAConnectionFactory fact, int poolSize, int connectionTimeout, String testQuery, boolean testOnBorrow)` Deprecated. Creates a new instance.

Method Summary
`void` | `close()` Deprecated. Cleans up the instance, and closes the pool.
`void` | `connectionClosed(ConnectionEvent arg)` Deprecated.
`void` | `connectionErrorOccurred(ConnectionEvent arg)` Deprecated.
`Connection` | `getConnection()` Deprecated.
`Connection` | `getConnection(HeuristicMessage msg)` Deprecated. Get a connection to the datasource for the given description of the work.
`Connection` | `getConnection(String msg)` Deprecated. Get a connection to the datasource for the given description of the work.
`Connection` | `getConnection(String username, String passwd)` Deprecated. Not implemented in this release; throws SQLException.
`Connection` | `getConnection(String user, String passwd, HeuristicMessage msg)` Deprecated. Not implemented in this release; throws SQLException.
`Connection` | `getConnection(String user, String passwd, String msg)` Deprecated. Get a connection to the datasource for the given description of the work.
`int` | `getLoginTimeout()` Deprecated.
`PrintWriter` | `getLogWriter()` Deprecated.
`PooledConnection` | `getPooledConnection()` Deprecated.
`PooledConnection` | `getPooledConnection(String user, String pw)` Deprecated.
`Reference` | `getReference()` Deprecated.
`TransactionalResource` | `getTransactionalResource()` Deprecated. Get the underlying transactional resource.
`void` | `setLoginTimeout(int seconds)` Deprecated.
`void` | `setLogWriter(PrintWriter pw)` Deprecated.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### JtaDataSourceImp

    public JtaDataSourceImp(XAConnectionFactory fact,
                            int poolSize,
                            int connectionTimeout,
                            String testQuery,
                            boolean testOnBorrow)
                     throws SQLException

  Deprecated.
  Creates a new instance.

  Parameters:
    `fact` - The XAConnectionFactory to use.
    `poolSize` - The size of the pool.
    `connectionTimeout` - The timeout in seconds for each connection.
    `testQuery` - A test query to validate connection liveness.
    `testOnBorrow` - If true then connections will be tested when gotten from the pool.
  Throws:
    `SQLException` - On error.

Method Detail

### getConnection

    public Connection getConnection()
                             throws SQLException

  Deprecated.
  Specified by:
    `getConnection` in interface `DataSource`
  Throws:
    `SQLException`
  See Also:
    `DataSource`

### getConnection

    public Connection getConnection(String username,
                                    String passwd)
                             throws SQLException

  Deprecated.
  Not implemented in this release; throws SQLException.

  Specified by:
    `getConnection` in interface `DataSource`
  Throws:
    `SQLException`

### getConnection

    public Connection getConnection(String user,
                                    String passwd,
                                    HeuristicMessage msg)
                             throws SQLException

  Deprecated.
  Not implemented in this release; throws SQLException.

  Specified by:
    `getConnection` in interface `HeuristicDataSource`
  Parameters:
    `user` - The user name to use.
    `passwd` - The password.
    `msg` - The heuristic message that best describes the work about to be done.
  Returns:
    Connection The connection.
  Throws:
    `SQLException` - On error.

### getLogWriter

    public PrintWriter getLogWriter()
                             throws SQLException

  Deprecated.
  Specified by:
    `getLogWriter` in interface `ConnectionPoolDataSource`
  Specified by:
    `getLogWriter` in interface `DataSource`
  Throws:
    `SQLException`
  See Also:
    `DataSource`

### setLogWriter

    public void setLogWriter(PrintWriter pw)
                      throws SQLException

  Deprecated.
  Specified by:
    `setLogWriter` in interface `ConnectionPoolDataSource`
  Specified by:
    `setLogWriter` in interface `DataSource`
  Throws:
    `SQLException`
  See Also:
    `DataSource`

### setLoginTimeout

    public void setLoginTimeout(int seconds)
                         throws SQLException

  Deprecated.
  Specified by:
    `setLoginTimeout` in interface `ConnectionPoolDataSource`
  Specified by:
    `setLoginTimeout` in interface `DataSource`
  Throws:
    `SQLException`
  See Also:
    `DataSource`

### getLoginTimeout

    public int getLoginTimeout()
                        throws SQLException

  Deprecated.
  Specified by:
    `getLoginTimeout` in interface `ConnectionPoolDataSource`
  Specified by:
    `getLoginTimeout` in interface `DataSource`
  Throws:
    `SQLException`
  See Also:
    `DataSource`

### close

    public void close()

  Deprecated.
  Cleans up the instance, and closes the pool.

### getTransactionalResource

    public TransactionalResource getTransactionalResource()

  Deprecated.
  Get the underlying transactional resource.

  Returns:
    TransactionalResource The resource.

### getReference

    public Reference getReference()
                           throws NamingException

  Deprecated.
  Specified by:
    `getReference` in interface `Referenceable`
  Throws:
    `NamingException`
  See Also:
    `Referenceable`

### getConnection

    public Connection getConnection(HeuristicMessage msg)
                             throws SQLException

  Deprecated.
  Description copied from interface: `HeuristicDataSource`
  Get a connection to the datasource for the given description of the work.

  Specified by:
    `getConnection` in interface `HeuristicDataSource`
  Parameters:
    `msg` - The heuristic message that best describes the work about to be done.
  Returns:
    Connection The connection.
  Throws:
    `SQLException` - On error.
  See Also:
    `HeuristicDataSource.getConnection(com.atomikos.icatch.HeuristicMessage)`

### connectionClosed

    public void connectionClosed(ConnectionEvent arg)

  Deprecated.
  Specified by:
    `connectionClosed` in interface `ConnectionEventListener`
  See Also:
    `ConnectionEventListener.connectionClosed(javax.sql.ConnectionEvent)`

### connectionErrorOccurred

    public void connectionErrorOccurred(ConnectionEvent arg)

  Deprecated.
  Specified by:
    `connectionErrorOccurred` in interface `ConnectionEventListener`
  See Also:
    `ConnectionEventListener.connectionErrorOccurred(javax.sql.ConnectionEvent)`

### getPooledConnection

    public PooledConnection getPooledConnection()
                                         throws SQLException

  Deprecated.
  Specified by:
    `getPooledConnection` in interface `ConnectionPoolDataSource`
  Throws:
    `SQLException`
  See Also:
    `ConnectionPoolDataSource.getPooledConnection()`

### getPooledConnection

    public PooledConnection getPooledConnection(String user,
                                                String pw)
                                         throws SQLException

  Deprecated.
  Specified by:
    `getPooledConnection` in interface `ConnectionPoolDataSource`
  Throws:
    `SQLException`
  See Also:
    `ConnectionPoolDataSource.getPooledConnection(java.lang.String, java.lang.String)`

### getConnection

    public Connection getConnection(String msg)
                             throws SQLException

  Deprecated.
  Description copied from interface: `HeuristicDataSource`
  Get a connection to the datasource for the given description of the work.

  Specified by:
    `getConnection` in interface `HeuristicDataSource`
  Parameters:
    `msg` - The heuristic message that best describes the work about to be done.
  Returns:
    Connection The connection.
  Throws:
    `SQLException` - On error.
  See Also:
    `HeuristicDataSource.getConnection(java.lang.String)`

### getConnection

    public Connection getConnection(String user,
                                    String passwd,
                                    String msg)
                             throws SQLException

  Deprecated.
  Description copied from interface: `HeuristicDataSource`
  Get a connection to the datasource for the given description of the work.

  Specified by:
    `getConnection` in interface `HeuristicDataSource`
  Parameters:
    `user` - The user name to use.
    `passwd` - The password.
    `msg` - The heuristic message that best describes the work about to be done.
  Returns:
    Connection The connection.
  Throws:
    `SQLException` - On error.
  See Also:
    `HeuristicDataSource.getConnection(java.lang.String, java.lang.String, java.lang.String)`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2012. All Rights Reserved.