我只知道在Oracle中获得所有表名的方法为
select * from tab;
你试试看

解决方案 »

  1.   

    try {
        Connection conn = Conn.getConnection(); //获得你自己的连接
        Statement stmt = conn.createStatement();
        String sql = "select * from tab";
        System.out.println(sql);
        ResultSet RS = stmt.executeQuery(sql);
        while (RS.next() ) {
          out.println(RS.getString(1)+"<br>");
        }
        stmt.close();
        conn.close();
      }
      catch (Exception ex) {
    System.out.println("First part's Error: "+ex.toString() );
      }
      

  2.   

    try {
        Connection conn = Conn.getConnection();//获得你自己的数据库连接
        Statement stmt = conn.createStatement();
        String sql = "select * from tab";
        System.out.println(sql);
        ResultSet RS = stmt.executeQuery(sql);
        while (RS.next() ) {
          out.println(RS.getString(1)+"<br>");
        }
        stmt.close();
        conn.close();
      }
      catch (Exception ex) {
    System.out.println("First part's Error: "+ex.toString() );
      }
      

  3.   

    我只知道oracle两种方法:
    select table_name from user_tables;
    select * from tab;
    建议里的数据库版去问问。
      

  4.   

    java.sql 
    Interface DatabaseMetaData
    getTables() 方法
    public ResultSet getTables(String catalog,
                               String schemaPattern,
                               String tableNamePattern,
                               String[] types)
                        throws SQLException
    这个是java中自带的类,如果能连接上数据库,都可以通用。
      

  5.   

    http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/Tools4.htmlThis command lists the names of all user tables in the database: ij> select tablename from sys.systables
        where tabletype = 'T';
      

  6.   

    不应该通过select语句去做,而是应该采用
    conn.getMetaData().getTables(conn.getCatalog(),"%","%",new String[]{"TABLE","VIEW"});
      

  7.   

    cowboy1114(傻牛)的方法行不通,
     zihuilegend(子辉)(愚昧无知) 的方法行不通,
     teaky2002(种田硬手) 的方法我查过javadoc,可行。
     liad() ( )的方法可行,不过不是用ibm ij 工具。
     ChDw(米) 的方法和teaky2002(种田硬手)一样。谢谢大家的支持。