Received: from cplane.com (IDENT:qmailr@jersey.cplane.com [63.193.105.226]) by hub.org (8.10.1/8.10.1) with SMTP id e73JjmG69107 for ; Thu, 3 Aug 2000 15:45:49 -0400 (EDT) Received: (qmail 17691 invoked from network); 3 Aug 2000 18:26:42 -0000 Received: from unknown (HELO texas.cplane.com) (unknown) by unknown with SMTP; 3 Aug 2000 18:26:42 -0000 Received: (qmail 5756 invoked from network); 3 Aug 2000 19:45:44 -0000 Received: from unknown (HELO cplane.com) (unknown) by unknown with SMTP; 3 Aug 2000 19:45:44 -0000 Message-ID: <3989CBE8.1BBF9535@cplane.com> Date: Thu, 03 Aug 2000 12:45:44 -0700 From: Bill X-Mailer: Mozilla 4.72 [en] (X11; U; Linux 2.2.12-20 i686) X-Accept-Language: en MIME-Version: 1.0 To: Peter Mount CC: pgsql-interfaces@postgresql.org Subject: Re: JDBC driver writes binary data ONLY as Large Object References: <1B3D5E532D18D311861A00600865478CF1B1B5@exchange1.nt.maidstone.gov.uk> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200008/39 Peter Mount wrote: > Hmmm, I see your point. There must be some way of encoding the string so > that the data is stored correctly. I know certain control characters can be > stored (cr/lf's etc) as I have a PHP script that does it here. > > Is it the new String(bytes[]) bit that barfs, or is it that the data is > mungled when it's re-read from the table? ------------------------------------------- java.sql.SQLException: ERROR: parser: parse error at or near "" at org.postgresql.Connection.ExecSQL(Connection.java, Compiled Code) at org.postgresql.jdbc2.Statement.execute(Statement.java, Compiled Code) at org.postgresql.jdbc2.Statement.executeUpdate(Statement.java:73) at org.postgresql.jdbc2.PreparedStatement.executeUpdate(PreparedStatement.java:126) ------------------------------------------- Perhaps we can look at the ResultSet.getBytes() and just do the inverse of that? Though I haven't tested if getBytes() is doing the right thing yet, either. In the end I need to be able to store/retrieve the data through both JDBC and ODBC interface. This is working now if I store all binary data as Large Objects. But most of my blobs of binary are only 200-2000 bytes long. I assume it is much less efficient to store such small blobs as LOs? That is, assuming the driver code is written well. So that may not be true with the current JDBC driver given that it would first have to convert the binary blob into a String. 8^( Bill