| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- import java.sql.*;
- public class ProbeSimulateLiquor {
- public static void main(String[] a) throws Exception {
- Class.forName("com.mysql.cj.jdbc.Driver");
- try (Connection master = DriverManager.getConnection(
- "jdbc:mysql://cq-cdb-8fjmemkb.sql.tencentcdb.com:27220/ylrz_saas?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8",
- "root", "Ylrz_1q2w3e4r5t6y")) {
- try (Statement st = master.createStatement()) {
- ResultSet rs = st.executeQuery(
- "SELECT id, tenant_code, db_url FROM tenant_info WHERE status=1 AND id=33");
- if (rs.next()) {
- System.out.println("tenant=" + rs.getLong(1) + " code=" + rs.getString(2)
- + " db=" + rs.getString(3));
- }
- }
- }
- try (Connection tenant = DriverManager.getConnection(
- "jdbc:mysql://cq-cdb-8fjmemkb.sql.tencentcdb.com:27220/fs_tenant_cs1?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8",
- "root", "Ylrz_1q2w3e4r5t6y")) {
- try (Statement st = tenant.createStatement()) {
- System.out.println("=== users ===");
- ResultSet rs = st.executeQuery(
- "SELECT user_id, user_name, nick_name, status FROM company_user WHERE del_flag='0' LIMIT 5");
- while (rs.next()) {
- System.out.println(rs.getLong(1) + " | " + rs.getString(2) + " | " + rs.getString(3));
- }
- System.out.println("=== templates liquor ===");
- rs = st.executeQuery(
- "SELECT id, template_name, industry_type, status FROM company_workflow_lobster "
- + "WHERE status=1 AND (industry_type='liquor' OR template_name LIKE '%酒%' OR template_name LIKE '%白酒%') "
- + "ORDER BY id DESC LIMIT 10");
- while (rs.next()) {
- System.out.println(rs.getLong(1) + " | " + rs.getString(2) + " | industry=" + rs.getString(3));
- }
- System.out.println("=== all active templates ===");
- rs = st.executeQuery(
- "SELECT id, template_name, industry_type FROM company_workflow_lobster WHERE status=1 ORDER BY id DESC LIMIT 8");
- while (rs.next()) {
- System.out.println(rs.getLong(1) + " | " + rs.getString(2) + " | " + rs.getString(3));
- }
- }
- }
- }
- }
|