提交 | 用户 | 时间
|
1ac2bc
|
1 |
package cn.stylefeng.guns.base.db.factory; |
懒 |
2 |
|
|
3 |
import cn.stylefeng.guns.base.db.entity.DatabaseInfo; |
|
4 |
import cn.stylefeng.roses.core.config.properties.DruidProperties; |
|
5 |
|
|
6 |
/** |
|
7 |
* 配置文件的创建 |
|
8 |
* |
|
9 |
* @author fengshuonan |
|
10 |
* @date 2019-06-15-20:05 |
|
11 |
*/ |
|
12 |
public class DruidFactory { |
|
13 |
|
|
14 |
/** |
|
15 |
* 创建druid配置 |
|
16 |
* |
|
17 |
* @author fengshuonan |
|
18 |
* @Date 2019-06-15 20:05 |
|
19 |
*/ |
|
20 |
public static DruidProperties createDruidProperties(DatabaseInfo databaseInfo) { |
|
21 |
|
|
22 |
DruidProperties druidProperties = new DruidProperties(); |
|
23 |
|
|
24 |
druidProperties.setDriverClassName(databaseInfo.getJdbcDriver()); |
|
25 |
druidProperties.setUsername(databaseInfo.getUserName()); |
|
26 |
druidProperties.setPassword(databaseInfo.getPassword()); |
|
27 |
druidProperties.setUrl(databaseInfo.getJdbcUrl()); |
|
28 |
|
|
29 |
return druidProperties; |
|
30 |
|
|
31 |
} |
|
32 |
|
|
33 |
} |