【7.3.4】【ds】新增一个创建druid配置的方法

(cherry picked from commit 9f25f52ae4)
pull/52/MERGE
fengshuonan 2023-03-22 16:20:06 +08:00
parent 18743c4b99
commit 587b46b08f
1 changed files with 16 additions and 0 deletions

View File

@ -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;
}
/**
* DataSourceDtodruid
*
* @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;
}
}