mirror of https://gitee.com/stylefeng/roses
【7.3.4】【ds】新增一个创建druid配置的方法
parent
2081c19ad4
commit
9f25f52ae4
|
@ -25,6 +25,7 @@
|
|||
package cn.stylefeng.roses.kernel.dsctn.modular.factory;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
|
@ -50,4 +51,19 @@ public class DruidPropertiesFactory {
|
|||
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