v6.5.3 and JDBC6.5-1.2 driver FastPath protocol Error: Z - Mailing list pgsql-general

From john
Subject v6.5.3 and JDBC6.5-1.2 driver FastPath protocol Error: Z
Date
Msg-id dsTQ7.687$CR2.263302@typhoon.maine.rr.com
Whole thread Raw
List pgsql-general
Hi,

I'm having a really hard time getting lobs into my database.  I've tried OID
and TEXT (VAR) for the column and I get the following error:

FastPath protocol error: Z

Here's my code (servlet running under Tomcat):

conn.setAutoCommit( false );

String line = "ABCDEFGHIJKLM";

 String strInsert = "insert into my_table ( message_id, from_user_id,
to_user_id, length, vm_message ) ";
 strInsert += "values( ?, ?, ?, ?, ? )";

 PreparedStatement ps = conn.prepareStatement( strInsert );
 ps.setInt( 1, 1 );         // message_id
 ps.setInt( 2, 155 );    // from_user_id
 ps.setInt( 3, 157 );    // to_user_id

 //
 // Apparently, InputStreams aren't supported under this version of the
postgres driver...
 // so use setBytes( ) instead of setBinaryStream( ... )
//


 ps.setInt( 4, (int)line.length() );       // length
 ps.setBytes( 5, line.getBytes() );   // vm_message

 ps.execute();

 ps.close();


Thanks for any tips,

John



pgsql-general by date:

Previous
From: "john"
Date:
Subject: Re: Inserting the current date
Next
From: James Thornton
Date:
Subject: Re: update returns 1, but no changes have been made