From: | "john" <servobit(at)m(dot)r(dot)c> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | v6.5.3 and JDBC6.5-1.2 driver FastPath protocol Error: Z |
Date: | 2001-12-10 00:36:25 |
Message-ID: | dsTQ7.687$CR2.263302@typhoon.maine.rr.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Doug McNaught | 2001-12-10 00:57:47 | Re: on update set default |
Previous Message | Travis Bear | 2001-12-09 23:49:29 | use BLOBS or use pointers to files on the filesystem? |