public class PoolDataSource
extends java.lang.Object
implements javax.sql.DataSource
限定符和类型 | 字段和说明 |
---|---|
private java.sql.Connection |
conn |
private DriverProperties |
driver |
private int |
maxLoginTime |
(专用程序包) DefaultConnectionPool |
pool |
private java.io.PrintWriter |
writer |
构造器和说明 |
---|
PoolDataSource(DefaultConnectionPool pool)
Constructor
|
限定符和类型 | 方法和说明 |
---|---|
java.sql.Connection |
getConnection() |
java.sql.Connection |
getConnection(java.lang.String userName,
java.lang.String pwd) |
int |
getLoginTimeout() |
java.io.PrintWriter |
getLogWriter() |
java.util.logging.Logger |
getParentLogger() |
java.sql.Connection |
getPhysicalConnection(java.lang.String userName,
java.lang.String password)
Get physical connection which is not from connection pool.
|
void |
init()
init
|
boolean |
isWrapperFor(java.lang.Class<?> iface) |
void |
release(java.sql.Connection conn)
release
|
void |
setLoginTimeout(int seconds) |
void |
setLogWriter(java.io.PrintWriter out) |
<T> T |
unwrap(java.lang.Class<T> iface) |
private DriverProperties driver
private java.sql.Connection conn
private java.io.PrintWriter writer
private int maxLoginTime
DefaultConnectionPool pool
public PoolDataSource(DefaultConnectionPool pool) throws OperationsException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.ClassNotFoundException
pool
- OperationsException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.InstantiationException
public void init() throws OperationsException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.ClassNotFoundException
OperationsException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.InstantiationException
public java.sql.Connection getPhysicalConnection(java.lang.String userName, java.lang.String password) throws OperationsException, java.sql.SQLException
userName
- password
- java.sql.SQLException
OperationsException
public void release(java.sql.Connection conn)
public java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
在接口中 javax.sql.DataSource
java.sql.SQLException
public java.sql.Connection getConnection(java.lang.String userName, java.lang.String pwd) throws java.sql.SQLException
getConnection
在接口中 javax.sql.DataSource
java.sql.SQLException
public void setLoginTimeout(int seconds) throws java.sql.SQLException
setLoginTimeout
在接口中 javax.sql.CommonDataSource
java.sql.SQLException
public int getLoginTimeout() throws java.sql.SQLException
getLoginTimeout
在接口中 javax.sql.CommonDataSource
java.sql.SQLException
public java.util.logging.Logger getParentLogger() throws java.sql.SQLFeatureNotSupportedException
getParentLogger
在接口中 javax.sql.CommonDataSource
java.sql.SQLFeatureNotSupportedException
public boolean isWrapperFor(java.lang.Class<?> iface) throws java.sql.SQLException
isWrapperFor
在接口中 java.sql.Wrapper
java.sql.SQLException
public <T> T unwrap(java.lang.Class<T> iface) throws java.sql.SQLException
unwrap
在接口中 java.sql.Wrapper
java.sql.SQLException
public java.io.PrintWriter getLogWriter() throws java.sql.SQLException
getLogWriter
在接口中 javax.sql.CommonDataSource
java.sql.SQLException
public void setLogWriter(java.io.PrintWriter out) throws java.sql.SQLException
setLogWriter
在接口中 javax.sql.CommonDataSource
java.sql.SQLException