public class PooledDataSource extends AbstractDataSource
| Constructor and Description |
|---|
PooledDataSource(ConnectionConfig<?> config)
构造
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
PooledConnection |
getConnection() |
Connection |
getConnection(String username,
String password) |
void |
returnObject(PooledConnection conn)
将连接返回到池中
|
PooledDataSource |
setDriver(Driver driver)
设置驱动
|
clone, getLoginTimeout, getLogWriter, getParentLogger, isWrapperFor, setLoginTimeout, setLogWriter, unwrapprotected Driver driver
public PooledDataSource(ConnectionConfig<?> config)
config - 数据库池配置public PooledDataSource setDriver(Driver driver)
driver - 驱动public PooledConnection getConnection() throws SQLException
SQLExceptionpublic Connection getConnection(String username, String password) throws SQLException
SQLExceptionpublic void close()
public void returnObject(PooledConnection conn)
conn - PooledConnectionCopyright © 2025. All rights reserved.