Derby
  1. Derby
  2. DERBY-5883

Simplify JSR-169 implementation class tree

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 10.10.1.1
    • Fix Version/s: 10.10.1.1
    • Component/s: JDBC
    • Labels:
      None

      Description

      The JSR-169 interface is a subset of JDBC 3.0, but still the JDBC 3.0 implementation classes do not extend the JSR-169 implementation classes. Instead, the JSR-169 and JDBC 3.0 implementation classes extend a common base class. The reason for this structure, is that the JSR-169 compile targets used to be optional, so the JDBC 3.0 classes could not depend on them.

      For example, the class javadoc comment for EmbedResultSet169 says:

      • ResultSet implementation for JSR169.
      • Adds no functionality to its (abstract) parent class.
      • If Derby could be compiled against JSR169 that the parent
      • class could be the concrete class for the environment.
      • Just like for the JDBC 2.0 specific classes.
      • Until that is possible (ie. easily downloadable J2ME/CDC/Foundation/JSR169
      • jar files, this class is required and is only compiled by an optional target.

      Since the JSR-169 code is no longer optional, we should do as the comment suggests, and use the base class directly instead. This would allow us to simplify the class tree.

      1. d5883-1a.diff
        13 kB
        Knut Anders Hatlen

        Activity

        Hide
        Knut Anders Hatlen added a comment -

        Attaching d5883-1a.diff, which makes the following changes:

        1) Removes EmbedResultSet169, EmbedPreparedStatement169, EmbedCallableStatement169

        2) Makes EmbedResultSet, EmbedPreparedStatement and EmbedCallableStatement non-abstract

        3) Makes Driver169 create instances of EmbedResultSet, EmbedPreparedStatement and EmbedCallableStatement instead of the classes with the "169" suffix

        4) Removed references to the removed classes from build.xml, and also updated it to use jsr169compile.classpath when compiling the classes that are supposed to work on CDC/FP

        5) Removed an unused import in ViewDescriptor.java. Although this sounds like an unrelated change, this import in fact made the build pull in many implementation classes when building one of the iapi targets. This made it compile the classes touched by this patch using the wrong classpath, which resulted in build errors after they were made non-abstract (the classes were compiled against the JDBC 3 interfaces, but only implemented the JSR-169 subset)

        I ran suites.All on Oracle Java ME Embedded Client 1.1, and suites.All and derbyall on Java 7. All tests passed.

        Show
        Knut Anders Hatlen added a comment - Attaching d5883-1a.diff, which makes the following changes: 1) Removes EmbedResultSet169, EmbedPreparedStatement169, EmbedCallableStatement169 2) Makes EmbedResultSet, EmbedPreparedStatement and EmbedCallableStatement non-abstract 3) Makes Driver169 create instances of EmbedResultSet, EmbedPreparedStatement and EmbedCallableStatement instead of the classes with the "169" suffix 4) Removed references to the removed classes from build.xml, and also updated it to use jsr169compile.classpath when compiling the classes that are supposed to work on CDC/FP 5) Removed an unused import in ViewDescriptor.java. Although this sounds like an unrelated change, this import in fact made the build pull in many implementation classes when building one of the iapi targets. This made it compile the classes touched by this patch using the wrong classpath, which resulted in build errors after they were made non-abstract (the classes were compiled against the JDBC 3 interfaces, but only implemented the JSR-169 subset) I ran suites.All on Oracle Java ME Embedded Client 1.1, and suites.All and derbyall on Java 7. All tests passed.
        Hide
        Knut Anders Hatlen added a comment -

        Committed revision 1372404.

        Show
        Knut Anders Hatlen added a comment - Committed revision 1372404.

          People

          • Assignee:
            Knut Anders Hatlen
            Reporter:
            Knut Anders Hatlen
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development