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, unwrap
protected Driver driver
public PooledDataSource(ConnectionConfig<?> config)
config
- 数据库池配置public PooledDataSource setDriver(Driver driver)
driver
- 驱动public PooledConnection getConnection() throws SQLException
SQLException
public Connection getConnection(String username, String password) throws SQLException
SQLException
public void close()
public void returnObject(PooledConnection conn)
conn
- PooledConnection
Copyright © 2025. All rights reserved.