[ 
http://issues.apache.org/jira/browse/DERBY-1501?page=comments#action_12420549 ] 

Knut Anders Hatlen commented on DERBY-1501:
-------------------------------------------

Kristian wrote:

> But what about the second issue? The embedded driver determines if
> the type of the parameter is "compatible" with the specified SQL
> type. Currently, BLOB is not seen to be compatible with BINARY,
> VARBINARY or LONGVARBINARY. The same goes for CLOB and the character
> types. I think the embedded driver might be doing the right thing. I
> have no problem understanding the logic in DataTypeDescriptor when I
> look at table B-5 in the JDBC 4 spec, but the table is for
> setObject. Can anyone weigh in on this?

I think table B-5 is the correct place to determine which types should
be considered compatible in setNull(). Therefore, embedded does not
violate the spec when it raises an exception.

However, I also think the client behaviour is compliant. The javadoc
for setNull(int,int) says nothing about this issue, but the javadoc
for setNull(int,int,String) says:

  If a JDBC driver does not need the type code or type name
  information, it may ignore it.

Derby doesn't need the type code, so ignoring it would be OK.

> PreparedStatement#setNull(int parameterIndex, int sqlType) throws SQL 
> Exception if given sqlType is LONGVARBINARY in embedded mode
> ----------------------------------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-1501
>          URL: http://issues.apache.org/jira/browse/DERBY-1501
>      Project: Derby
>         Type: Bug

>     Versions: 10.1.1.0
>  Environment: WindowsXP
>     Reporter: Markus Fuchs
>  Attachments: ByteArrayTest.java
>
> When inserting a row into following table
> BYTEARRAY_TEST( ID int, BYTEARRAY_VAL blob)
> PreparedStatement#setNull(int parameterIndex, int sqlType) throws SQL 
> Exception if given sqlType is LONGVARBINARY. You must give sqlType BLOB to 
> make the insert work. The same test works using sqlType LONGVARBINARY in 
> network mode. The following combinations don't work:
> Column type               sqlType not working             mandatory sqlType
> BLOB                           LONGVARBINARY                 BLOB
> CLOB                           LONGVARCHAR                    CLOB
> The issue here is that first Derby behaves differently in network and 
> embedded mode. And secondly, should accept LONGVARBINARY/LONGVARCHAR for 
> BLOB/CLOB columns.

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