跟java无关。不同的数据库都有不同的语句可以取出库中表的个数。

解决方案 »

  1.   

    if oracle, you can use system.all_objs. included in this views.
    if MYSql, you can use show tables;
      

  2.   

    String[] TableType={"TABLE","VIEW"};
    dbMeta=connection.getMetaData();
    resultset=dbMeta.getTables("数据库名",null,null,TableType);                while(resultset.next()){
                        TableName=resultset.getObject(3).toString();
                        listdata.addElement (TableName);
                    }
      

  3.   


    select * from sys.dba_all_tables where owner='ANDY'or select * from sys.dba_objects  where owner='ANDY'