|
From: Tom T. <tom...@pr...> - 2004-06-03 14:31:46
|
Hello Juergen,
While upgrading all of our applications to Spring 1.0.2, I noticed
newPreparedStatementCreator() in SqlOperation has become final. Though
this is probably a good thing, I currently don't see an easy way to have
SqlOperation use a custom PreparedStatementCreatorFactory...
We have some queries (extending SqlQuery) that use sql parameters of type
ARRAY, e.g.:
new SqlParameter( "dg_ids", Types.ARRAY, "DISCHARGE.NT_DIS_IDS" )
and thus require a custom (Oracle-specific)
PreparedStatementCreator/Setter to do something like this:
case Types.ARRAY:
ps.setArray( idx, getOracleArray( con, declaredParam.getTypeName(),
param ) );
break;
private ARRAY getOracleArray( Connection con, String typeName, Object obj
) throws SQLException {
Connection nativeCon = getNativeConnection( con );
return new ARRAY( ArrayDescriptor.createDescriptor( typeName,
nativeCon ), nativeCon, obj );
}
I was overriding newPreparedStatementCreator() to force the use of my own
OraclePreparedStatementCreator, but this is no longer possible, and, in
fact, I don't see another way of accomplishing this...
Maybe compileInternal() in SqlOperation could delegate the creation of
preparedStatementFactory to a protected
"createPreparedStatementCreatorFactory" method?
Kind regards,
Tom.
|