[ 
http://issues.apache.org/jira/browse/DERBY-1610?page=comments#action_12429424 ] 
            
Knut Anders Hatlen commented on DERBY-1610:
-------------------------------------------

Yes, I think you can decide the correct type on the client side. 
ParameterMetaData (which can be obtained through 
PreparedStatement.getParameterMetaData()) contains this information.

To test, I created a prepared statement with

        String sql = "VALUES (" +
            "CAST (? AS SMALLINT)," +
            "CAST (? AS INTEGER)," +
            "CAST (? AS BIGINT)," +
            "CAST (? AS VARCHAR(128))," +
            "CAST (? AS CLOB)," +
            "CAST (? AS BLOB)," +
            "CAST (? AS TIMESTAMP))";
        PreparedStatement ps = c.prepareStatement(sql);

I was able to retrieve the correct parameter types with 
ParameterMetaData.getParameterType() and 
ParameterMetaData.getParameterTypeName().

> Updating column typed as CHAR to value passed via setBinaryStream(notNull) is 
> failed because of imcompatiblity of types though it was not taken as error 
> when setBinaryStream(null)
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1610
>                 URL: http://issues.apache.org/jira/browse/DERBY-1610
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server, Network Client
>            Reporter: Tomohito Nakayama
>         Assigned To: Tomohito Nakayama
>         Attachments: DERBY-1610.diff, DERBY-1610_2.diff, 
> parameterMapping.diff, parameterMapping.diff, TestNullChar.java
>
>
> There exists difference between updating character typed column to value 
> passed via setBinaryStream(notNullValue) and updating the column to value 
> passed via setBinaryStream(null).
> This difference is problematic because it does not exist in Embedded mode.

-- 
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

        

Reply via email to