Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-5244

DatabaseMetaData.getColumns(null, null, tableName, null) does not return the columns meta for a SYNONYM

    XMLWordPrintableJSON

Details

    • Normal

    Description

      DatabaseMetaData.getColumns(null, null, tableName, null) does not return the columns meta for a SYNONYM.

      Sample java code use for testing.

      /**

      • ListColumns.java
        */
        import java.sql.*;
        import java.util.Properties;

      public class ListColumns {
      public static void main(String[] args) {
      Connection con = null;
      try {

      Class.forName("org.apache.derby.jdbc.ClientDriver");

      Properties connectionProps = new Properties();
      connectionProps.put("user", "app");
      connectionProps.put("password", "app");

      con = DriverManager.getConnection(
      "jdbc:derby://localhost:1527/northwind", connectionProps);

      String tableName = "V1";

      DatabaseMetaData meta = con.getMetaData();
      System.out.println("Database Product Version"
      + meta.getDatabaseProductVersion());

      ResultSet res = meta.getColumns(null, null, tableName, null);
      System.out.println("List of columns for " + tableName);
      while (res.next())

      { System.out.println(" " + res.getString("TABLE_SCHEM") + ", " + res.getString("TABLE_NAME") + ", " + res.getString("COLUMN_NAME") + ", " + res.getString("TYPE_NAME") + ", " + res.getInt("COLUMN_SIZE") + ", " + res.getString("NULLABLE")); }

      res.close();

      con.close();
      } catch (java.lang.ClassNotFoundException e)

      { System.err.println("ClassNotFoundException: " + e.getMessage()); }

      catch (SQLException e)

      { System.err.println("SQLException: " + e.getMessage()); }

      }
      }

      Attachments

        1. DERBY-5244.diff
          0.7 kB
          Camilla Haase
        2. rrefjdbc15905.html
          7 kB
          Camilla Haase

        Activity

          People

            chaase3 Camilla Haase
            pgodey Prashanth Godey
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: