ShowMasterRoleMenuTables.java 740 B

1234567891011121314151617
  1. import java.sql.*;
  2. public class ShowMasterRoleMenuTables {
  3. private static final String HOST = "cq-cdb-8fjmemkb.sql.tencentcdb.com:27220";
  4. private static final String USER = "root";
  5. private static final String PASS = "Ylrz_1q2w3e4r5t6y";
  6. public static void main(String[] args) throws Exception {
  7. Class.forName("com.mysql.cj.jdbc.Driver");
  8. try (Connection c = DriverManager.getConnection(
  9. "jdbc:mysql://" + HOST + "/ylrz_saas?useSSL=false&serverTimezone=GMT%2B8", USER, PASS);
  10. Statement st = c.createStatement();
  11. ResultSet rs = st.executeQuery("SHOW TABLES LIKE '%role_menu%'")) {
  12. while (rs.next()) System.out.println(rs.getString(1));
  13. }
  14. }
  15. }