com.atomikos.jdbc.nonxa
Class NonXADataSourceImp

java.lang.Object
  extended by com.atomikos.jdbc.nonxa.NonXADataSourceImp
All Implemented Interfaces:
HeuristicDataSource, EventListener, Referenceable, ConnectionEventListener, DataSource

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

public class NonXADataSourceImp
extends Object
implements HeuristicDataSource, ConnectionEventListener, Referenceable

A DataSource implementation that is capable of handling 2-phase commit and transactions without requiring XA support from the JDBC drivers of the database. Instances can be used to involve non-XA databases in a transaction, at the risk of not being able to recover prepared transactions (recovery of prepared transactions will result in heuristics).


Constructor Summary
NonXADataSourceImp(DataSource driver, String jndiName, String user, String password, int poolSize, int connectionTimeout, boolean validation, String testQuery, boolean testOnBorrow)
          Deprecated. Create a new instance.
NonXADataSourceImp(DataSource driver, String jndiName, String user, String password, int poolSize, int connectionTimeout, String testQuery, boolean testOnBorrow)
          Deprecated. Create a new instance.
 
Method Summary
 void close()
          Deprecated. Closes the datasource (and shuts down the pool).
 void connectionClosed(ConnectionEvent event)
          Deprecated.  
 void connectionErrorOccurred(ConnectionEvent arg0)
          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 user, String pw)
          Deprecated.  
 Connection getConnection(String user, String passwd, HeuristicMessage msg)
          Deprecated. Get a connection to the datasource for the given description of the work.
 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.  
 Reference getReference()
          Deprecated.  
 void setLoginTimeout(int val)
          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

NonXADataSourceImp

public NonXADataSourceImp(DataSource driver,
                          String jndiName,
                          String user,
                          String password,
                          int poolSize,
                          int connectionTimeout,
                          String testQuery,
                          boolean testOnBorrow)
                   throws SQLException
Deprecated. 
Create a new instance.

Parameters:
driver - The original datasource driver to use. This can be a MySQL, for instance. Note: don't use a pooling driver!
jndiName - The unique global JNDI name to bind this instance on.
user - The username to get connections for. Empty string or null if no user authentication should be used.
password - The password, null or empty if no user authentication should be used.
poolSize - The size of the connection pool.
connectionTimeout - The number of seconds after which the pool's connections are checked periodically.
testQuery - A SQL test query to validate connection liveness.
testOnBorrow - Should connections be tested when gotten?
Throws:
SQLException

NonXADataSourceImp

public NonXADataSourceImp(DataSource driver,
                          String jndiName,
                          String user,
                          String password,
                          int poolSize,
                          int connectionTimeout,
                          boolean validation,
                          String testQuery,
                          boolean testOnBorrow)
                   throws SQLException
Deprecated. 
Create a new instance.

Parameters:
driver - The original datasource driver to use. This can be a MySQL, for instance. Note: don't use a pooling driver!
jndiName - The unique global JNDI name to bind this instance on.
user - The username to get connections for. Empty string or null if no user authentication should be used.
password - The password, null or empty if no user authentication should be used.
poolSize - The size of the connection pool.
connectionTimeout - The number of seconds after which the pool's connections are checked periodically.
validation - True if the instance will be used for validation only. No binding is done in that case.
testQuery - A query to validate connection liveness.
testOnBorrow - Should connections be tested when gotten?
Throws:
SQLException
Method Detail

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)

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)

getConnection

public Connection getConnection(String user,
                                String passwd,
                                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:
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, com.atomikos.icatch.HeuristicMessage)

getConnection

public Connection getConnection()
                         throws SQLException
Deprecated. 
Specified by:
getConnection in interface DataSource
Throws:
SQLException
See Also:
DataSource.getConnection()

getConnection

public Connection getConnection(String user,
                                String pw)
                         throws SQLException
Deprecated. 
Specified by:
getConnection in interface DataSource
Throws:
SQLException

getLogWriter

public PrintWriter getLogWriter()
                         throws SQLException
Deprecated. 
Specified by:
getLogWriter in interface DataSource
Throws:
SQLException
See Also:
DataSource.getLogWriter()

setLogWriter

public void setLogWriter(PrintWriter pw)
                  throws SQLException
Deprecated. 
Specified by:
setLogWriter in interface DataSource
Throws:
SQLException
See Also:
DataSource.setLogWriter(java.io.PrintWriter)

setLoginTimeout

public void setLoginTimeout(int val)
                     throws SQLException
Deprecated. 
Specified by:
setLoginTimeout in interface DataSource
Throws:
SQLException
See Also:
DataSource.setLoginTimeout(int)

getLoginTimeout

public int getLoginTimeout()
                    throws SQLException
Deprecated. 
Specified by:
getLoginTimeout in interface DataSource
Throws:
SQLException
See Also:
DataSource.getLoginTimeout()

connectionClosed

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

connectionErrorOccurred

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

close

public void close()
Deprecated. 
Closes the datasource (and shuts down the pool).


getReference

public Reference getReference()
                       throws NamingException
Deprecated. 
Specified by:
getReference in interface Referenceable
Throws:
NamingException
See Also:
Referenceable


Copyright © 2011. All Rights Reserved.