You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Anurag Shekhar (JIRA)" <de...@db.apache.org> on 2006/03/22 09:22:01 UTC

[jira] Updated: (DERBY-1137) Implement the new method introduced in CommonDataSource for Embedded Driver

     [ http://issues.apache.org/jira/browse/DERBY-1137?page=all ]

Anurag Shekhar updated DERBY-1137:
----------------------------------

    Attachment: derby-1137.diff
                stat.out

Description of patch
This patch contains the implementation of new methods in javax.sql.CommonDataSource for Embedded jdbc driver.

JDBC4.0 introduces a new method getQueryObjectGenerator () in java.sql.CommonDataSource. This class is base class of javax.sql.DataSource, javax.sql.ConnectionPoolDataSource and javax.sql.XADataSource. So the new methods needs to implemented by three DataSource available in derby.

Return type of this method is java.sql.QueryObjectGenerator which is a jdbc4.0 
class. due to this class implementing this method should be in a class which is used only with jdbc4.0.

This patch also introduces the connection classes required due to introduction of new methods in PoolableConnection. The new methods introduced in PoolableMethods are addConnectionEventListener and addStatementEventListener. These two methods needs to implemented in jdbc4.0 implementation of PoolableConnection and XAConnection.

Newly introduced classes in this patch follows the similar inheritance hierarchy used in existing classes 
ie
    EmbeddedDataSource40 extends from EmbeddedDataSource
    EmbeddedConnectionPoolDataSource40 and EmbeddedXADataSource40 extends from EmbeddedDataSource

    EmbeddedPooledConnection40 extends from EmbeddedPooledConnection
    EmbeddedXAConnection40 extends from EmbeddedPooledConnection40

EmbeddedXAConnection40 implements XAResource too.

EmbeddedXAConnection has some methods (most of it inherited from BrokeredConnection and EmbeddedConnection) which is used by many internal classes. Even though these methods are available in EmbeddedXAConnection40 these two not compatible because of no inheritance relationship. To over come this problem I have introduced a new interface InternalXAConnection which has methods used in internal classes. 
EmbeddedXAConnection and EmbeddedXAConnection40 implement this method.

To share the XAResource implementation a new class InternalXAResource is introduced and the XAResource calls to EmbeddedXAConnection and EmbeddedXAConnection40 is redirected to InternalXAResource.

Due to introduction of interface InternalXAConnection some of the method needed to change the access modifier. Two of such methods were getUser and getPassword. I assumed the restricted access to this method is due to security reason so it wasn't a good idea to make these method public. To overcome this problem I have introduced a new class UserInfo. The public method in InternalXAConnection returns UserInfo object which has two getter and these getters can be accessed only from the same package.In addition to this the class is immutable and values are transient.



> Implement the new method introduced in CommonDataSource for Embedded Driver
> ---------------------------------------------------------------------------
>
>          Key: DERBY-1137
>          URL: http://issues.apache.org/jira/browse/DERBY-1137
>      Project: Derby
>         Type: Sub-task
>   Components: JDBC
>  Environment: jdk1.6 jdbc4.0
>     Reporter: Anurag Shekhar
>     Assignee: Anurag Shekhar
>      Fix For: 10.2.0.0
>  Attachments: derby-1137.diff, stat.out
>


-- 
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