|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atomikos.jdbc.nonxa.NonXADataSourceImp
AtomikosNonXADataSourceBean
should be used instead.
public class NonXADataSourceImp
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 |
---|
public NonXADataSourceImp(DataSource driver, String jndiName, String user, String password, int poolSize, int connectionTimeout, String testQuery, boolean testOnBorrow) throws SQLException
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?
SQLException
public NonXADataSourceImp(DataSource driver, String jndiName, String user, String password, int poolSize, int connectionTimeout, boolean validation, String testQuery, boolean testOnBorrow) throws SQLException
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?
SQLException
Method Detail |
---|
public Connection getConnection(String msg) throws SQLException
HeuristicDataSource
getConnection
in interface HeuristicDataSource
msg
- The heuristic message that best describes the work about to be
done.
SQLException
- On error.HeuristicDataSource.getConnection(java.lang.String)
public Connection getConnection(String user, String passwd, String msg) throws SQLException
HeuristicDataSource
getConnection
in interface HeuristicDataSource
user
- The user name to use.passwd
- The password.msg
- The heuristic message that best describes the work about to be
done.
SQLException
- On error.HeuristicDataSource.getConnection(java.lang.String,
java.lang.String, java.lang.String)
public Connection getConnection(HeuristicMessage msg) throws SQLException
HeuristicDataSource
getConnection
in interface HeuristicDataSource
msg
- The heuristic message that best describes the work about to be
done.
SQLException
- On error.HeuristicDataSource.getConnection(com.atomikos.icatch.HeuristicMessage)
public Connection getConnection(String user, String passwd, HeuristicMessage msg) throws SQLException
HeuristicDataSource
getConnection
in interface HeuristicDataSource
user
- The user name to use.passwd
- The password.msg
- The heuristic message that best describes the work about to be
done.
SQLException
- On error.HeuristicDataSource.getConnection(java.lang.String,
java.lang.String, com.atomikos.icatch.HeuristicMessage)
public Connection getConnection() throws SQLException
getConnection
in interface DataSource
SQLException
DataSource.getConnection()
public Connection getConnection(String user, String pw) throws SQLException
getConnection
in interface DataSource
SQLException
public PrintWriter getLogWriter() throws SQLException
getLogWriter
in interface DataSource
SQLException
DataSource.getLogWriter()
public void setLogWriter(PrintWriter pw) throws SQLException
setLogWriter
in interface DataSource
SQLException
DataSource.setLogWriter(java.io.PrintWriter)
public void setLoginTimeout(int val) throws SQLException
setLoginTimeout
in interface DataSource
SQLException
DataSource.setLoginTimeout(int)
public int getLoginTimeout() throws SQLException
getLoginTimeout
in interface DataSource
SQLException
DataSource.getLoginTimeout()
public void connectionClosed(ConnectionEvent event)
connectionClosed
in interface ConnectionEventListener
ConnectionEventListener.connectionClosed(javax.sql.ConnectionEvent)
public void connectionErrorOccurred(ConnectionEvent arg0)
connectionErrorOccurred
in interface ConnectionEventListener
ConnectionEventListener.connectionErrorOccurred(javax.sql.ConnectionEvent)
public void close()
public Reference getReference() throws NamingException
getReference
in interface Referenceable
NamingException
Referenceable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |