db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <derby-...@db.apache.org>
Subject [jira] Updated: (DERBY-137) Derby metadata always returns JDBC 2 result sets, even when JDBC 3 result sets are required.
Date Wed, 21 Jun 2006 13:13:31 GMT
     [ http://issues.apache.org/jira/browse/DERBY-137?page=all ]

Knut Anders Hatlen updated DERBY-137:
-------------------------------------

    Attachment: derby-137-v1.diff
                derby-137-v1.stat

The attached patch changes the data types and adds missing columns so
that the result sets returned from DatabaseMetaData methods match the
latest revision of the JDBC 4.0 spec. Derbyall ran cleanly on Sun JVM
1.5.0/Solaris 10 x64.

Summary of the changes:

  DatabaseMetaData:

    - getProcedureColumns: modified VTI to return an int instead of a
      short for the DATA_TYPE column

    - getTables: new columns: TYPE_CAT, TYPE_SCHEM, TYPE_NAME,
      SELF_REFERENCING_COL_NAME, REF_GENERATION (all null since Derby
      doesn't support typed tables)

    - getColumns: DATA_TYPE changed from SMALLINT to INTEGER. New
      columns: SCOPE_CATLOG, SCOPE_SCHEMA, SCOPE_TABLE,
      SOURCE_DATATYPE (all null since Derby doesn't support the REF or
      DISTINCT data types)

    - getVersionColumns: SCOPE, DECIMAL_DIGITS and PSEUDO_COLUMN
      changed from INTEGER to SMALLINT

    - getPrimaryKeys: KEY_SEQ changed from INTEGER to SMALLINT

    - getTypeInfo: DATA_TYPE, NULLABLE, SEARCHABLE, MINIMUM_SCALE and
      MAXIMUM_SCALE changed from SMALLINT to INTEGER. 

    - getIndexInfo: ORDINAL_POSITION changed from INTEGER to SMALLINT

    - getBestRowIdentifier: DATA_TYPE changed from SMALLINT to INTEGER

    - getUDTs: new columm: BASE_TYPE (null since Derby doesn't support
      the DISTINCT type or SELF_REFERENCING_COLUMN)

  ODBCMetadataGenerator:

    - cast DATA_TYPE columns to SMALLINT (as defined by ODBC)

  Tests:

    - updated master files for metadata, odbc_metadata,
      bestrowidentifier, declareGlobalTempTableJava and
      Upgrade_10_1_10_2 (new columns and modified data types)

    - odbc_metadata.java: added information about nullability for some
      of the new columns to avoid ArrayIndexOutOfBoundsException

> Derby metadata always returns JDBC 2 result sets, even when JDBC 3 result sets are required.
> --------------------------------------------------------------------------------------------
>
>          Key: DERBY-137
>          URL: http://issues.apache.org/jira/browse/DERBY-137
>      Project: Derby
>         Type: Bug

>   Components: JDBC
>     Reporter: A B
>     Assignee: Knut Anders Hatlen
>     Priority: Critical
>  Attachments: derby-137-v1.diff, derby-137-v1.stat
>
> BACKGROUND:
> Derby's implementation of the JDBC class java.sql.DatabaseMetaData returns result sets
that are defined by the SQL queries in impl/jdbc/metadata.properties.
> PROBLEM:
> The current queries in the metadata.properties file are for JDBC 2 only.  The queries
do NOT account for the result sets as defined by JDBC 3, and thus even when JDBC 3 result
sets should be returned, a user will get metadata correlating to the JDBC 2 standard.
> Just for reference, here are a couple of examples of changes that have been made from
JDBC 2 to JDBC 3:
> 1) getColumns(): JDBC 2 specifies 18 columns, JDBC 3 specifies 22 (the four extra columns
are SCOPE_CATALOG, SCOPE_SCHEMA, SCOPE_TABLE, and SOURCE_DATA_TYPE).
> 2) getTables(): JDBC 2 specifics 5 columns, JDBC 3 specifies 10 (the five extra columns
are TYPE_CAT, TYPE_SCHEM, TYPE_NAME, SELF_REFERENCING_COL_NAME, and REF_GENERATION).
> 3) getProcedureColumns(): JDBC 2 specifies that DATA_TYPE is a "short"; JDBC 3 specifies
that DATA_TYPE is an "int".
> NOTES:
> JDBC 3 needs to be backward compatible with JDBC 2, so it should be okay to just modify
metadata.properties to return JDBC 3 result sets...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message