|
From: <tho...@tr...> - 2004-06-03 15:26:33
|
Tom,
While I don't know why this was changed to final, I have been thinking about
providing some additional features to the SqlParameter class. One idea would
be to add a "TypeHandler" class that could do what you are looking for without
having to use a custom PreparedStatementCreator. The TypeHandler would be
modeled after the current LobHandler.
Thomas
Quoting Tom Turelinckx <tom...@pr...>:
> 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.
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by the new InstallShield X.
> >From Windows to Linux, servers to mobile, InstallShield X is the one
> installation-authoring solution that does it all. Learn more and
> evaluate today! http://www.installshield.com/Dev2Dev/0504
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
|