地质所 沉降监测网建设项目
chenhuan
2024-05-16 0fdd42e318f51f9e3c6581473416af1cca69877f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package com.javaweb.quartz.config;
 
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
 
@Component
@ConfigurationProperties(prefix = "spring.datasource.druid.master")
public class DbParamConfig {
    private String url;
    private String username;
    private String password;
 
    private String databaseName;
    private String host;
    private String port;
 
    public void setUrl(String url) {
        this.url = url.substring(url.indexOf("://")+3, url.indexOf("?"));
        this.databaseName = this.url.split("/")[1];
        this.host = this.url.split("/")[0].split(":")[0];
        this.port = this.url.split("/")[0].split(":")[1];
    }
 
    public String getDatabaseName() {
        return databaseName;
    }
 
    public String getHost() {
        return host;
    }
 
    public String getPort() {
        return port;
    }
 
    public String getUsername() {
        return username;
    }
 
    public void setUsername(String username) {
        this.username = username;
    }
 
    public String getPassword() {
        return password;
    }
 
    public void setPassword(String password) {
        this.password = password;
    }
}