0 Replies Latest reply: Aug 11, 2012 8:37 PM by 954797 RSS

    ResultSetMetaData#getTableName return empty.How to set ResultSetMet?

    954797
      Java JDBC Code
      ------------------------------------------------------------------
      ResultSetMetaData rsmd = rs.getMetaData();
      .....

      String columnLable=rsmd.getColumnLabel(n)
      Sring tableName=rsmd.getTableName(n)
      ------------------------------------------------------------------

      tableName always empty.(I can get it in mysql5 but oracle11g)

      I follow this link
      http://docs.oracle.com/cd/E13222_01/wls/docs91/jdbc_drivers/oracle.html#1074995
      decribe the ResultSetMetaDataOptions can be set to 1, So can return the tableName.

      I tried many ways.
      ------------------------------------------------------------------
      Properties info = new java.util.Properties();
      info.put ("user",this.username);
      info.put ("password",this.password);
      info.put ("ResultSetMetaDataOptions","1");
      Connection conn = DriverManager.getConnection(this.url,info);
      ------------------------------------------------------------------
      But it still empty.


      How to set ResultSetMetaDataOptions?
      -------------------------------------------
      I'm very appreciated your help

      帖子经 user9501163编辑过