v6.5.3 and JDBC6.5-1.2 driver FastPath protocol Error: Z

Started by johnover 24 years ago1 messagesgeneral
Jump to latest
#1john
servobit@m.r.c

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