Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4234316

JdbcOdbc, level 3.0 '...StoresMixedCase...' returns incorrect values

XMLWordPrintable

    • 005
    • generic
    • generic



        Name: mf23781 Date: 04/30/99


        This JdbcOdbc problem was found when testing with an Oracle
        Level 3 ODBC driver.
        .
        Our AIX testing environment is
        -JDK 116 Jdbc-Odbc Bridge on AIX 4.3.0.0
        -ODBC Driver: evaluation release version 03.50 for AIX downloaded from www.merant.com: http://www.merant.com/datadirect/download/eval/Forms/connect_odbc.htx
        -Database: oracle 8.0.4 on AIX 4.3.0.0
        .
        The test suite that we are using is the JDBC compliant test suite downloaded from Javasoft partner site in the private area: jdbc.tests.src and jdbc-harness which controls the running of the tests.
        .
        For the defect on supportsMixedCaseIdentifiers() and supportsMixedCaseQuotedIdentifiers(), the following test is to be used: jdbcTest.dbmetadata.DBInfo
        .
        The supportsMixedCaseIdentifiers() & supportsMixedCaseQuotedIdentifiers()
        methods return booleans describing the Drivers support for these concepts.
        These values are defined in the JDBC 1.2 spec for a JDBC Compliant Driver.
        .
        The jdbc-odbc bridge implementation of java.sql.DatabaseMetaData returns an incorrect value for both of these values:
        supportsMixedCaseIdentifiers() returns true (spec is false)
        supportsMixedCaseQuotedIdentifiers() returns false (spec is true)
        .
        .
        According to JDBC specification:
        .
        The 2 methods returns true or false to indicate whether
        the database treat mixed case SQL identifiers as case sensitive
        and as a result store them in mixed case for the unquoted
        and quoted cases in the above 2 methods.
        .
        The original code is:
        .
        return ((value == OdbcDef.SQL_IC_MIXED) ||
        (value == OdbcDef.SQL_IC_UPPER) ||
        (value == OdbcDef.SQL_IC_LOWER));
        .
        when it should be:
        .
        return (value == OdbcDef.SQL_IC_SENSITIVE);
        .
        .
        According to ODBC specifications:
        .
        SQL_IC_UPPER:
        Identifiers in SQL are not case-sensitive and are stored in
        uppercase in the system catalogue.
        .
        SQL_IC_LOWER:
        Identifiers in SQL are not case-sensitive and are stored in
        lowercase in the system catalogue.
        .
        SQL_IC_SENSITIVE:
        Identifers in SQL are case-sensitive and are stored in mixed
        case in the system catalogue.
        .
        SQL_IC_MIXED:
        Identifiers in SQL are not case-sensitive and are stored in
        mixed case in the system catalogue.
        .
        .
        Fix:
        .
        The fix in JdbcOdbcDatabaseMetaData.java is shown as diff output:
        .
        (supportsMixedCaseIdentifiers)
        342,345c342,344
        < //return ((value == OdbcDef.SQL_IC_MIXED) ||
        < // (value == OdbcDef.SQL_IC_UPPER) ||
        < // (value == OdbcDef.SQL_IC_LOWER));
        < return (value == OdbcDef.SQL_IC_SENSITIVE); /*ibm D9457*/
        ---
        > return ((value == OdbcDef.SQL_IC_MIXED) ||
        > (value == OdbcDef.SQL_IC_UPPER) ||
        > (value == OdbcDef.SQL_IC_LOWER));
        .
        (supportsMixedCaseQuotedIdentifiers)
        409,412c408,410
        < //return ((value == OdbcDef.SQL_IC_MIXED) ||
        < // (value == OdbcDef.SQL_IC_UPPER) ||
        < // (value == OdbcDef.SQL_IC_LOWER));
        < return (value == OdbcDef.SQL_IC_MIXED); /*ibm D9457*/
        ---
        > return ((value == OdbcDef.SQL_IC_MIXED) ||
        > (value == OdbcDef.SQL_IC_UPPER) ||
        > (value == OdbcDef.SQL_IC_LOWER));
        .
        Note: dots have been inserted on all blank lines to maintain
        readability

        (Review ID: 57678)

        ======================================================================

              duke J. Duke
              miflemi Mick Fleming
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: