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 DataBaseExportTest { 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 listSql = GenCodeGauss.export(CONN, dbName); String sql = StringUtil.join(listSql, "\n\n"); System.out.println(sql); } }