读取数据表

读取数据表

复制代码
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();
        
    }
复制代码

 

posted @   西北逍遥  阅读(78)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示