Hi Martin,

thank you for your answer.

I found out that there is the method getInnermostDelegate() on the DBCP DelegatingPreparedStatement calling this will return the original PreparedStatement independently on how many hierarchies of wrappers DBCP is using.


I reviewed your suggested DBCP-fix and this will not make it into
the default Oracle9i platform, as the imports would add a DBCP run-time dependency when using OJB and Oracle9i platform (which is not currently the case and would apply even for users that don't want DBCP).


I will try to make a more flexible support for all types of wrapped conenctions using reflection calls. If this is not possible your code could always extend the default platform and make a new "PlatformDbcpOracle9iImp",
but this would be my personal last choice...



Ok I didn't think at the runtime dependencies, following code uses reflection and avoids these external dependencies (maybe you already implemented it like this)

PreparedStatement innerPS;
try
{
    Method delgGetter = ClassHelper.getMethod( ps, "getInnermostDelegate", null 
);
    innerPS = ( delgGetter != null ) ? (PreparedStatement) delgGetter.invoke( 
ps, null ) : ps;
} catch ( Exception ignore ) {
    innerPS = ps;
}

where ps is the 'potentially' wrappped PreparedStatement and innerPS is the 
original unwrapped PreparedStatement on which the setBLOB/CLOB methods can be 
called.

bye
danilo


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



Reply via email to