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.