读取数据表

读取数据表

public static void searchAllTable() {
        //String sql="SELECT * FROM information_schema.`TABLES`";
        String sql="select table_name from information_schema.tables where table_schema='vc_2021030601';";
        
        MySQLConnect.connectMySQL();
        ResultSet rs=MySQLConnect.runSQL(sql);
        
        
        try {
            while (rs.next()) {
                String tableName = rs.getString(1);
                if(tableName.startsWith("r_")) {
                    continue;
                }
                
                if(tableName.startsWith("t_")) {
                    continue;
                }
                //System.out.println(""+tableName+"");
                listTables.add(tableName);
            }
        } catch (SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        
        MySQLConnect.close();
        
    }
QQ 3087438119
原文地址:https://www.cnblogs.com/herd/p/14600903.html