shikeying
2024-01-11 3b67e947e36133e2a40eb2737b15ea375e157ea0
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
package com.walker.connector;
 
import com.walker.jdbc.DataSourceMeta;
 
/**
 * 本地(主要)数据库地址信息对象。
 * 在采集模块中,通过该对象可以直接连接自己数据库。
 * @date 2022-09-13
 * @author 时克英
 */
public class LocalAddress extends Address {
 
    public LocalAddress(DataSourceMeta dataSourceMeta){
        if(dataSourceMeta == null){
            throw new IllegalArgumentException("DataSourceMeta 必须提供!");
        }
//        String jdbcUrl = dataSourceMeta.getUrl();
        this.setUrl(dataSourceMeta.getIp());
        this.setPort(dataSourceMeta.getPort());
        this.setService(dataSourceMeta.getDatabaseName());
        this.setAuthentication(dataSourceMeta.getUsername());
        this.setCertification(dataSourceMeta.getPassword());
        this.setUsing(true);
    }
 
}