db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@debrunners.com>
Subject Re: Accessing JDBC30 methods with jdk131
Date Thu, 13 Jan 2005 17:06:04 GMT
Hash: SHA1

> From: Kathey Marsden <kmarsden@Sourcery.Org>
> Subject: Accessing JDBC30 methods  with  jdk131
> Content-Type: text/plain; charset=us-ascii
> Hash: SHA1
> I am working on some issues with XA and Network Server and jdk131.
> Network Server needs to access some of the JDBC30 methods such as
> PreparedStatement.getParameterMetaData() to send parameter information
> back to the client.
> Network Server uses reflection to access these methods. For example, it
> needs to access the parameterMetaData call for regular connections from.
> 	EmbedPreparedStatement
> 	EmbedPreparedStatement30
> and for XA Connections from
> 	BrokeredPreparedStatement
> 	BrokeredPreparedStatement30
> (Currently there is a method getEmbedParameterSetMetaData() in
> EmbedPreparedStatement which is the same thing as
> EmbedPreparedStatement30.getParameterMetaData() which is what Network
> Server calls for regular connections so we have access from jdk131.)
> Currently the options I see for providing access to the JDBC30 methods
> for XA are.
> 1) Get rid of the *30 Classes and just put the JDBC30 methods in the
> BrokeredPreparedStatement and EmbedPreparedStatement classes.

The split is needed to ensure there is no chance of a class not found
exception of a JDBC 3.0 class when running in jdk131.

> 2) Import the Embed* classes into the Brokered* classes and create
> methods like getEmbedParameterSetMetaData there. Really messy because
> currently the Brokered* classes don't import any internal classes at all.

Messy as you say, the Brokered classes are intended to be general
purpose wrapper classes.

How about option 3)

Make the getStatement() method in BrokeredStatement public and have code
something like

   if (stmt instance BrokeredPreparedStatement)
       EmbedPreparedStatement eps = (EmbedPreparedStatement)
(BrokeredPreparedStatement) stmt.getStatement());

    then you have direct access to what you require.


Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


View raw message