mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
修复PooledConnection可能的数据库驱动未找到问题
This commit is contained in:
parent
d897fced85
commit
fecbbb4ce8
@ -14,6 +14,7 @@ package org.dromara.hutool.db.ds.pooled;
|
||||
|
||||
import org.dromara.hutool.core.map.MapUtil;
|
||||
import org.dromara.hutool.core.pool.Poolable;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.db.DbException;
|
||||
import org.dromara.hutool.db.config.ConnectionConfig;
|
||||
import org.dromara.hutool.setting.props.Props;
|
||||
@ -42,6 +43,16 @@ public class PooledConnection extends ConnectionWrapper implements Poolable<Conn
|
||||
* @param dataSource 数据源
|
||||
*/
|
||||
public PooledConnection(final ConnectionConfig<?> config, final PooledDataSource dataSource) {
|
||||
// issue#IA6EUQ 部分驱动无法自动加载,此处手动完成
|
||||
final String driver = config.getDriver();
|
||||
if(StrUtil.isNotBlank(driver)){
|
||||
try {
|
||||
Class.forName(driver);
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new DbException(e);
|
||||
}
|
||||
}
|
||||
|
||||
final Props info = new Props();
|
||||
final String user = config.getUser();
|
||||
if (user != null) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user