Hi !

I have a pretty weird problem, I use a Derby 10.3.1.4 with the ClientDriver and 
I run the code below:

    // Data is a byte[] vector
    ByteArrayInputStream is = new ByteArrayInputStream( data);    
    String sql = "UPDATE MyTable SET FContents=? WHERE FName='" + name + "'";
    PreparedStatement ps = conn.prepareStatement( sql);
    ps.setBinaryStream( 1, is, data.length);
    
    if( ps.executeUpdate() == 0)
    {
        // it throws an exception here if the data array us larger then around 
32750 bytes!!!
    }

Connection is "jdbc:derby://localhost/mydb;create=true;"

java.sql.SQLException: A network protocol error was encountered and the 
connection has been terminated: A PROTOCOL Data Stream Syntax Error was 
detected.  Reason: 0x0. Plaintext connection attempt to an SSL enabled server?
        at 
org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Source)
        at org.apache.derby.client.am.SqlException.getSQLException(Unknown 
Source)
        at org.apache.derby.client.am.PreparedStatement.executeUpdate(Unknown 
Source)

The table is defined as:
    CREATE TABLE MyTable (FName varchar(300) NOT NULL,FContents BLOB(16M) NOT 
NULL)

I do not understand why it only works with small BLOB contents, as soon as I 
pass 32750 bytes or so the above happens,
when data is 32750 or smaller it works just fine.

Reply via email to