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

Reply via email to