Hi Amita

  Indeed we need a better way to handle this, my only concern with
this approach are the unknown side effects we can get if the exception
returned when you first pass the Statement.RETURN_GENERATED_KEYS is
not related to the JDBC driver supporting or not generated keys.

On 7/9/07, Amita Vadhavkar <[EMAIL PROTECTED]> wrote:
Hi,

We are at present hardcoding some vendors (e.g. Oracle) in ConnectionImpl to
decide whether to
use autogenerated key feature in preparedStatement. This logic is subject to
change
as and when new features are supported by different databases and different
vendors.
Instead, if we have a flexibility to check in the very first attempt of
connection.prepareStatement(queryString, Statement.RETURN_GENERATED_KEYS);
throws exception and based on that, if we can tweak the decision making
flag useGetGeneratedKeys to true/false, then,  at any runtime of DAS,
"maximum once", there is
a chance that exception will be thrown / caught and later all attempts will
follow
correct syntax of connection.prepareStatement() as supported by the current
rdbms
driver being used.  Based on JDBC specs, the only exception possible from
connection.prepareStatement()
is SQLException.

This check can be introduced in ConnectionImpl.prepareStatement().
Thoughts?

Regards,
Amita



--
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to