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