[ 
https://issues.apache.org/jira/browse/DERBY-2786?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12503710
 ] 

Dag H. Wanvik commented on DERBY-2786:
--------------------------------------

One could handle this by changing getXXX to retrieve the value, if
set, from the parameters_ array, ca so:

    int getIntX(int parameterIndex) throws SqlException {
       :
       setWasNull(parameterIndex);

        if (wasNull_ == WAS_NULL_UNSET && 
                parameterSet_[parameterIndex - 1]) {
            return getInt(parameters_[parameterIndex - 1]);
        } else {
            return wasNullX() ? 0 : singletonRowData_.getInt(parameterIndex);
        }
    }

but one needs to handle type conversion/checking appropriately as well
(inside the new getInt(Object o) above). The current conversion methods are 
geared to pick
up data from the query execution result, not the parameter array, so fixing 
this will 
likely require a whole new set of conversion methods.


> Behaviour of inout parameters in Embedded and Network client is different if 
> parameters are set but the CallableStatment is not executed.


> ---------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2786
>                 URL: https://issues.apache.org/jira/browse/DERBY-2786
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.3.0.0
>         Environment: Operating Systems: Fedora Core release 6 
>            Reporter: Ramin Moazeni
>         Attachments: Main.java
>
>
> The behavior of embedded and network client is different in for inout
> parameters if parameters are set but the CallableStatment is not executed.  
> For detailed description of this issue on derby-dev, refer to
> http://www.nabble.com/Regarding-DERBY-2658%3A-Converting-jdbcapi-parameterMetaDataJdbc30.java-to-JUnit-tf3882490.html#a11003923

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to