in Oracle, you can
select * from user_tables 
where table_name = 'name';then use the resultset to judge

解决方案 »

  1.   

    能说详细一些吗?
    select * from user_tables 
    where table_name = 'name';
          ~~~~~~~~~~~~~~~~~~
    这是什么意思啊通过判断resultset是否为空>?
      

  2.   

    select * from user_tables 
    where table_name = 'name';
                       ~~~~~~~~这在程序里要用什么替代呢?自己要找的表名?
    那前面的table_name呢,是指什么?
      

  3.   

    如果你用的是SQL SERVER
    select * from sysobjects where name='表名'
      

  4.   

    如果在ORACLE中赞成的imrhold(imrhold) 的说法。
    判断是否为空就可以了呀!
    我是JAVA初学者
    呵呵来凑凑热闹!
      

  5.   

    name 就是你要找的表名,判断是否为空就行啦。
      

  6.   


    如果你用的是SQL SERVER
    select * from sysobjects where name='表名'那在oracle呢
      

  7.   

    table_name是user_tables里面的变量名, user_tables(tabs)是系统表, 他维护了所有系统中表的信息
    有空看看Desc tabs不就
    顺便说一句, 如果你需要动态去数据库看表存不存在的话, 你可能会有一些其他的问题 -__-;
      

  8.   

    Zhakrin() 兄台点化得好。
    但具体的代码要怎么实现啊
    String sql="select * from tabs where table_name = 'tabel name';
    try{   
        }
    catch(java.sql.SQLException e1){  
           //自己建表的语句
        }
    是这样吗?
      

  9.   

    不是的, 你不会出Exception
    看ResultSet是否为空, 如果是的话再CreateTable
    另外记得把这个Label成Oracle版的, SQLServer铁定出Exception
      

  10.   

    String sql="select * from tabs where table_name = 'tabel name';
    执行sql获得rs
    if(rs.next()){
             //表存在}
    else{表不存在 
           //自己建表的语句
        }//Is this right  ???