mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-24 18:04:54 +08:00
fix code
This commit is contained in:
parent
b090fbdd3d
commit
baad5158a8
@ -186,4 +186,16 @@ public class ConnectionConfig<T extends ConnectionConfig<?>> {
|
||||
this.poolProps.setProperty(key, value);
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ConnectionConfig{" +
|
||||
"driver='" + driver + '\'' +
|
||||
", url='" + url + '\'' +
|
||||
", user='" + user + '\'' +
|
||||
", pass='****" + '\'' +
|
||||
", connProps=" + connProps +
|
||||
", poolProps=" + poolProps +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ public class C3p0DSFactory implements DSFactory {
|
||||
// 连接配置
|
||||
final Properties connProps = config.getConnProps();
|
||||
if(MapUtil.isNotEmpty(connProps)){
|
||||
ds.setProperties(connProps);
|
||||
ds.getProperties().putAll(connProps);
|
||||
}
|
||||
|
||||
return ds;
|
||||
|
@ -104,7 +104,7 @@ public class DsTest {
|
||||
public void c3p0DsuserAndPassTest() {
|
||||
// https://gitee.com/dromara/hutool/issues/I4T7XZ
|
||||
DSUtil.setGlobalDSFactory(new C3p0DSFactory());
|
||||
final ComboPooledDataSource ds = (ComboPooledDataSource) ((DSWrapper) DSUtil.getDS("mysql")).getRaw();
|
||||
final ComboPooledDataSource ds = (ComboPooledDataSource) DSUtil.getDS("mysql").getRaw();
|
||||
Assertions.assertEquals("root", ds.getUser());
|
||||
Assertions.assertEquals("123456", ds.getPassword());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user