[ http://issues.apache.org/jira/browse/IBATIS-145?page=comments#action_12312790 ]
Brandon Goodin commented on IBATIS-145: --------------------------------------- I was just trying to determine if what we are facing is an oddity of the driver or if this is truly a change that we need to make to the ibatis code. You did not provide the full story at first. I have no knowledge of your expertise. So, basically, it sounded like you were saying that you needed to specify a user defined type for a varray which the oracle driver can successfully convert to an array. But, i can see that you truly have a bonified user defined sql type. When reporting issues it is helpful if you explain what solutions you have attempted and provide all the details up front. Thanks for your insight and code submission. I'd like to get some comments from the other developers before we commit this change. Thoughts? > oracle's user-defined objects are not supported as store procedure out > parameters > --------------------------------------------------------------------------------- > > Key: IBATIS-145 > URL: http://issues.apache.org/jira/browse/IBATIS-145 > Project: iBatis for Java > Type: Improvement > Components: SQL Maps > Versions: 2.1.0 > Environment: oracle and maybe any others db that support user defined data > types > Reporter: ppz4j > > we have to call legacy oracle store procedure with named array types as > output parameters. When I try it I get an invalid parameter type exception > This problem arises because to use these params the SQLExecutor class should > call the ?callableStatement.registerOutputParameters? method version with > the typeName param. In fact the java doc of this method suggests "This > version of the method registerOutParameter should be used for a user-defined > or REF output parameter" and "To be portable, however, applications should > always provide these values for user-defined and REF parameters. Although it > is intended for user-defined and REF parameters, this method may be used to > register a parameter of any JDBC type. If the parameter does not have a > user-defined or REF type, the typeName parameter is ignored " > To handle this problem I have made some changes in source code and dtd file, > but I hope that in a next version this problem will be resolved. > > Following the changes that I have made to add this enhancement: > Added property typeName to bean BasicParameterMapping, with set and get > methods. > Added code that load typeName param from xml in SqlMapParser and code that > save it as property of the current instance of mapping. > Changed the SQLExecutor, now before call the > CallableStatement.registerOutputParameter the registerOutputParameters method > checks if the typeName of the given map parameter is not null. If it so it > calls the overloaded method registerOutParameter(int paramIndex,int > sqlType,String typeName) instead of registerOutParameter(int paramIndex,int > sqlType. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira