private static class TempTableDataSourceProvider.DataSourceImpl
extends java.lang.Object
implements javax.sql.DataSource
DataSource interface, which maintains context-local data for each
private temp-table connection.| Modifier and Type | Class and Description |
|---|---|
private static class |
TempTableDataSourceProvider.DataSourceImpl.Context
Context-specific data.
|
class |
TempTableDataSourceProvider.DataSourceImpl.TempProxyConnection
A proxy connection for the temporary database.
|
| Modifier and Type | Field and Description |
|---|---|
private static ContextLocal<TempTableDataSourceProvider.DataSourceImpl.Context> |
context
Context local variable to hold context-specific data
|
private static CentralLogger |
LOG
Logger
|
| Modifier | Constructor and Description |
|---|---|
private |
DataSourceImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Intercept close requests to close the physical database connection only when there is no temp-table
which still needs it.
|
java.sql.Connection |
getConnection()
Attempts to establish a connection with the data source of the
_temp database. |
java.sql.Connection |
getConnection(java.lang.String username,
java.lang.String password)
Attempts to establish a connection with the data source of the
_temp database. |
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) |
private static final CentralLogger LOG
private static final ContextLocal<TempTableDataSourceProvider.DataSourceImpl.Context> context
public java.sql.Connection getConnection()
throws java.sql.SQLException
_temp database.
Uses the credentials from the DatabaseManager configuration.getConnection in interface javax.sql.DataSourcejava.sql.SQLException - if a database access error occurs.public java.sql.Connection getConnection(java.lang.String username,
java.lang.String password)
throws java.sql.SQLException
_temp database.
If credentials are null, the DatabaseManager configuration is inspected
for their values.getConnection in interface javax.sql.DataSourceusername - The database user on whose behalf the connection is made. If null, the
value is read form @code DatabaseManager}'s configuration.password - The password of the database user on whose behalf the connection is made. If
null, the value is read form @code DatabaseManager}'s configuration.java.sql.SQLException - if a database access error occurs.public boolean isWrapperFor(java.lang.Class<?> iface)
throws java.sql.SQLException
isWrapperFor in interface java.sql.Wrapperjava.sql.SQLExceptionpublic <T> T unwrap(java.lang.Class<T> iface)
throws java.sql.SQLException
unwrap in interface java.sql.Wrapperjava.sql.SQLExceptionpublic java.io.PrintWriter getLogWriter()
getLogWriter in interface javax.sql.CommonDataSourcepublic void setLogWriter(java.io.PrintWriter out)
setLogWriter in interface javax.sql.CommonDataSourcepublic void setLoginTimeout(int seconds)
setLoginTimeout in interface javax.sql.CommonDataSourcepublic int getLoginTimeout()
getLoginTimeout in interface javax.sql.CommonDataSourcepublic java.util.logging.Logger getParentLogger()
throws java.sql.SQLFeatureNotSupportedException
getParentLogger in interface javax.sql.CommonDataSourcejava.sql.SQLFeatureNotSupportedExceptionpublic void close()
throws java.sql.SQLException
java.sql.SQLException - if there is an error closing the connection.