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

Поиск
Список
Период
Сортировка
От john
Тема v6.5.3 and JDBC6.5-1.2 driver FastPath protocol Error: Z
Дата
Msg-id dsTQ7.687$CR2.263302@typhoon.maine.rr.com
обсуждение исходный текст
Список 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 по дате отправления:

Предыдущее
От: "john"
Дата:
Сообщение: Re: Inserting the current date
Следующее
От: James Thornton
Дата:
Сообщение: Re: update returns 1, but no changes have been made