Skip to content

Commit 96d3f56

Browse files
author
Axel Dörfler
committed
PooledDataSource: allow arbitrary unpooled source.
* This for example allows you to configure a connection before putting it in the pool.
1 parent 1d69b3d commit 96d3f56

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/java/org/apache/ibatis/datasource/pooled/PooledDataSource.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ public PooledDataSource() {
6060
dataSource = new UnpooledDataSource();
6161
}
6262

63+
public PooledDataSource(UnpooledDataSource dataSource) {
64+
this.dataSource = dataSource;
65+
}
66+
6367
public PooledDataSource(String driver, String url, String username, String password) {
6468
dataSource = new UnpooledDataSource(driver, url, username, password);
6569
expectedConnectionTypeCode = assembleConnectionTypeCode(dataSource.getUrl(), dataSource.getUsername(), dataSource.getPassword());

0 commit comments

Comments
 (0)