mirror of https://gitee.com/stylefeng/roses
parent
18743c4b99
commit
587b46b08f
|
@ -25,6 +25,7 @@
|
||||||
package cn.stylefeng.roses.kernel.dsctn.modular.factory;
|
package cn.stylefeng.roses.kernel.dsctn.modular.factory;
|
||||||
|
|
||||||
import cn.stylefeng.roses.kernel.db.api.pojo.druid.DruidProperties;
|
import cn.stylefeng.roses.kernel.db.api.pojo.druid.DruidProperties;
|
||||||
|
import cn.stylefeng.roses.kernel.dsctn.api.pojo.DataSourceDto;
|
||||||
import cn.stylefeng.roses.kernel.dsctn.modular.entity.DatabaseInfo;
|
import cn.stylefeng.roses.kernel.dsctn.modular.entity.DatabaseInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -50,4 +51,19 @@ public class DruidPropertiesFactory {
|
||||||
return druidProperties;
|
return druidProperties;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过DataSourceDto创建druid连接配置
|
||||||
|
*
|
||||||
|
* @author fengshuonan
|
||||||
|
* @date 2023/3/22 16:19
|
||||||
|
*/
|
||||||
|
public static DruidProperties createDruidProperties(DataSourceDto dataSourceDto) {
|
||||||
|
DruidProperties druidProperties = new DruidProperties();
|
||||||
|
druidProperties.setDriverClassName(dataSourceDto.getJdbcDriver());
|
||||||
|
druidProperties.setUsername(dataSourceDto.getUsername());
|
||||||
|
druidProperties.setPassword(dataSourceDto.getPassword());
|
||||||
|
druidProperties.setUrl(dataSourceDto.getJdbcUrl());
|
||||||
|
return druidProperties;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue