public class ExternalDataSource extends Object implements DataSource
When a connection is requested it gets a connection from the pool and attach such connection to the current transaction. When the transaction completes the data source connection is automatically completed as well.
Modifier and Type | Field and Description |
---|---|
protected DataSourceEntry |
dataSourceEntry |
protected static org.slf4j.Logger |
log |
protected String |
name |
Constructor and Description |
---|
ExternalDataSource() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
getAutoCommit(Connection conn) |
Connection |
getConnection() |
Connection |
getConnection(String username,
String password) |
DataSourceEntry |
getDataSourceEntry() |
int |
getLoginTimeout() |
PrintWriter |
getLogWriter() |
String |
getName() |
Logger |
getParentLogger() |
boolean |
isDisableAutoCommit() |
boolean |
isWrapperFor(Class<?> c) |
protected void |
setAutoCommit(Connection conn,
boolean autocommit) |
void |
setDataSourceEntry(DataSourceEntry dataSourceEntry) |
void |
setDisableAutoCommit(boolean disableAutoCommit) |
void |
setLoginTimeout(int seconds) |
void |
setLogWriter(PrintWriter out) |
void |
setName(String name) |
<T> T |
unwrap(Class<T> c) |
protected static transient org.slf4j.Logger log
protected String name
protected DataSourceEntry dataSourceEntry
public String getName()
public void setName(String name)
public void setDataSourceEntry(DataSourceEntry dataSourceEntry)
public DataSourceEntry getDataSourceEntry()
public int getLoginTimeout() throws SQLException
getLoginTimeout
in interface CommonDataSource
SQLException
public void setLoginTimeout(int seconds) throws SQLException
setLoginTimeout
in interface CommonDataSource
SQLException
public PrintWriter getLogWriter() throws SQLException
getLogWriter
in interface CommonDataSource
SQLException
public void setLogWriter(PrintWriter out) throws SQLException
setLogWriter
in interface CommonDataSource
SQLException
public boolean isDisableAutoCommit()
public void setDisableAutoCommit(boolean disableAutoCommit)
public Connection getConnection(String username, String password) throws SQLException
getConnection
in interface DataSource
SQLException
public Connection getConnection() throws SQLException
getConnection
in interface DataSource
SQLException
public Logger getParentLogger()
getParentLogger
in interface CommonDataSource
protected boolean getAutoCommit(Connection conn)
protected void setAutoCommit(Connection conn, boolean autocommit)
public boolean isWrapperFor(Class<?> c)
isWrapperFor
in interface Wrapper
Copyright © 2012-2015 JBoss by Red Hat. All Rights Reserved.