public final class LocalTransactionDataSource
extends java.lang.Object
implements javax.sql.DataSource
This instance is thread safe.
LocalTransaction| Constructor and Description |
|---|
LocalTransactionDataSource(javax.sql.DataSource dataSource)
Creates an instance.
|
LocalTransactionDataSource(java.lang.String url,
java.lang.String user,
java.lang.String password)
Creates an instance with information about the connection.
|
| Modifier and Type | Method and Description |
|---|---|
java.sql.Connection |
getConnection() |
java.sql.Connection |
getConnection(java.lang.String username,
java.lang.String password) |
KeepAliveLocalTransaction |
getKeepAliveLocalTransaction(JdbcLogger jdbcLogger)
Returns a keep alive local transaction.
|
KeepAliveLocalTransaction |
getKeepAliveLocalTransaction(JdbcLogger jdbcLogger,
TransactionIsolationLevel transactionIsolationLevel)
Returns a keep alive local transaction with the specified transaction level.
|
LocalTransaction |
getLocalTransaction(JdbcLogger jdbcLogger)
Returns a local transaction.
|
LocalTransaction |
getLocalTransaction(JdbcLogger jdbcLogger,
TransactionIsolationLevel transactionIsolationLevel)
Returns a local transaction with the specified transaction level.
|
int |
getLoginTimeout() |
java.io.PrintWriter |
getLogWriter() |
java.util.logging.Logger |
getParentLogger() |
boolean |
isWrapperFor(java.lang.Class<?> iface) |
void |
setLoginTimeout(int seconds) |
void |
setLogWriter(java.io.PrintWriter out) |
<T> T |
unwrap(java.lang.Class<T> iface) |
public LocalTransactionDataSource(javax.sql.DataSource dataSource)
dataSource - the internal data sourceDomaNullPointerException - if the dataSource is nullpublic LocalTransactionDataSource(java.lang.String url,
java.lang.String user,
java.lang.String password)
url - a database urluser - the database userpassword - the user's passwordDomaNullPointerException - if the url is nullpublic java.sql.Connection getConnection()
getConnection in interface javax.sql.DataSourceTransactionNotYetBegunException - if the transaction is not yet begunLocalTransactionpublic java.sql.Connection getConnection(java.lang.String username,
java.lang.String password)
getConnection in interface javax.sql.DataSourceTransactionNotYetBegunException - if the transaction is not yet begunLocalTransactionpublic int getLoginTimeout()
throws java.sql.SQLException
getLoginTimeout in interface javax.sql.CommonDataSourcejava.sql.SQLExceptionpublic java.io.PrintWriter getLogWriter()
throws java.sql.SQLException
getLogWriter in interface javax.sql.CommonDataSourcejava.sql.SQLExceptionpublic boolean isWrapperFor(java.lang.Class<?> iface)
throws java.sql.SQLException
isWrapperFor in interface java.sql.Wrapperjava.sql.SQLExceptionpublic void setLoginTimeout(int seconds)
throws java.sql.SQLException
setLoginTimeout in interface javax.sql.CommonDataSourcejava.sql.SQLExceptionpublic void setLogWriter(java.io.PrintWriter out)
throws java.sql.SQLException
setLogWriter in interface javax.sql.CommonDataSourcejava.sql.SQLExceptionpublic <T> T unwrap(java.lang.Class<T> iface)
throws java.sql.SQLException
unwrap in interface java.sql.Wrapperjava.sql.SQLExceptionpublic LocalTransaction getLocalTransaction(JdbcLogger jdbcLogger)
jdbcLogger - the loggerDomaNullPointerException - if the jdbcLogger is nullpublic LocalTransaction getLocalTransaction(JdbcLogger jdbcLogger, TransactionIsolationLevel transactionIsolationLevel)
jdbcLogger - the loggertransactionIsolationLevel - the transaction isolation levelDomaNullPointerException - if any arguments are nullpublic KeepAliveLocalTransaction getKeepAliveLocalTransaction(JdbcLogger jdbcLogger)
jdbcLogger - the loggerDomaNullPointerException - if the jdbcLogger is nullpublic KeepAliveLocalTransaction getKeepAliveLocalTransaction(JdbcLogger jdbcLogger, TransactionIsolationLevel transactionIsolationLevel)
jdbcLogger - the loggertransactionIsolationLevel - the isolation levelDomaNullPointerException - if any arguments are nullpublic java.util.logging.Logger getParentLogger()
throws java.sql.SQLFeatureNotSupportedException
getParentLogger in interface javax.sql.CommonDataSourcejava.sql.SQLFeatureNotSupportedException