liulin
2024-08-13 6b7b2214ef457a953381226dc42354d237d6b295
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
package com.lunhan.xxx.host;
 
import com.lunhan.xxx.common.util.StringUtil;
 
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.List;
 
public class GaussExportTest {
    public static void main(String[] args) {
        String dbName = "water_trade_center";
 
        Connection CONN;
        //获得连接
        try {
            CONN = DriverManager.getConnection("jdbc:postgresql://113.250.189.120:57654/" + dbName, "lunhan", "lunhan.20240330");
        } catch (SQLException e) {
            System.out.println(e.toString());
            return;
        }
 
        List<String> listSql = GenCodeGauss.export(CONN, dbName);
        String sql = StringUtil.join(listSql, "\n\n");
 
        System.out.println(sql);
    }
}