| 1234567891011121314151617181920 |
- import java.sql.*;
- public class Q {
- static final String U = "jdbc:mysql://cq-cdb-8fjmemkb.sql.tencentcdb.com:27220/%s?useSSL=false&serverTimezone=GMT%%2B8&characterEncoding=utf8";
- public static void main(String[] a) throws Exception {
- query("tenant_sys_menu", "ylrz_saas");
- query("company_menu", "fs_tenant_cs1");
- }
- static void query(String t, String db) throws Exception {
- System.out.println("\n## " + db + "." + t);
- try (Connection c = DriverManager.getConnection(String.format(U, db), "root", "Ylrz_1q2w3e4r5t6y");
- ResultSet rs = c.createStatement().executeQuery(
- "SELECT menu_id, menu_name, path, component, visible, status FROM "+t+
- " WHERE menu_id=29900 OR parent_id=29900 ORDER BY parent_id, order_num, menu_id")) {
- while (rs.next()) {
- System.out.printf("%d\t%s\t%s\t%s\tvis=%s\tst=%s%n",
- rs.getLong(1), rs.getString(2), rs.getString(3), rs.getString(4), rs.getString(5), rs.getString(6));
- }
- }
- }
- }
|