db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DERBY-5880) Move java.sql.Wrapper implementations to base classes in embedded driver
Date Thu, 26 Jul 2012 11:15:34 GMT

     [ https://issues.apache.org/jira/browse/DERBY-5880?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Knut Anders Hatlen updated DERBY-5880:

    Attachment: d5880-1a.diff

Attaching d5880-1a.diff which moves the Wrapper methods to super-classes where that may enable
more reuse.

Unfortunately, EmbedStatement40, EmbedPreparedStatement40 and EmbedCallableStatement40 don't
have a common sub-class compiled against Java 5 yet, so the had to keep their separate implementations.

In the brokered classes, however, the implementations in BrokeredStatement40, BrokeredPreparedStatement40
and BrokeredCallableStatement40 could be replaced by a single one in BrokeredStatement.

In EmbedParameterMetaData40, the Wrapper methods were moved to EmbedParameterMetaData30, which
made the EmbedParameterMetaData40 class empty so it could be removed.

In the data source classes, the Wrapper methods in EmbedDataSource40, EmbeddedConnectionPoolDataSource40
and EmbeddedXADataSource40 could be replaced by a single implementation in EmbededDataSource.
This change also made the data source classes that are not suffixed with "40", implement the
full JDBC 4.0 interface. The javadoc comments in the classes were updated to say that.

Because the JDBC 3 data source classes are more capable than before, JDBC4FromJDBC3DataSourceTest
had to be updated. It expected calls to the Wrapper methods to result in AbstractMethodErrors
when using the JDBC 3 flavour of the data sources, but now they succeed.

Finally, I came across two methods (setBinaryStream() and setCharacterStream()) in EmbedCallableStatement40
that had equivalent implementations in the super-class EmbedPreparedStatement, so I removed
them and let EmbedCallableStatement40 inherit them instead.

All the regression tests ran cleanly with the patch.
> Move java.sql.Wrapper implementations to base classes in embedded driver
> ------------------------------------------------------------------------
>                 Key: DERBY-5880
>                 URL: https://issues.apache.org/jira/browse/DERBY-5880
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions:
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>            Priority: Minor
>         Attachments: d5880-1a.diff
> Now that the JDBC 3.0 classes in the embedded driver are compiled with source level 1.5,
we could move the unwrap()/isWrapperFor() methods to the base classes to enable reuse, like
we did for the client driver in DERBY-5868.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


View raw message