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 e71Jb5B86785 for ; Tue, 1 Aug 2000 15:37:05 -0400 (EDT) Received: (qmail 7845 invoked from network); 1 Aug 2000 18:18:06 -0000 Received: from unknown (HELO texas.cplane.com) (unknown) by unknown with SMTP; 1 Aug 2000 18:18:06 -0000 Received: (qmail 6709 invoked from network); 1 Aug 2000 19:37:03 -0000 Received: from unknown (HELO cplane.com) (unknown) by unknown with SMTP; 1 Aug 2000 19:37:03 -0000 Message-ID: <398726DF.D52AACA7@cplane.com> Date: Tue, 01 Aug 2000 12:37:03 -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: pgsql-interfaces@postgresql.org Subject: JDBC driver writes binary data ONLY as Large Object Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200008/6 The problem is that PreparedStatement.setBytes() only writes Large Objects. It should do something like ResultSet.getBytes(), which checks the column meta-data to see if the column holds an OID or not, then do the right thing based on that. Bill ------------------------------------------------- .../postgresql-7.0.2/src/interfaces/jdbc/org/postgresql/jdbc2/PreparedStatement.java /** * Set a parameter to a Java array of bytes. The driver converts this * to a SQL VARBINARY or LONGVARBINARY (depending on the argument's * size relative to the driver's limits on VARBINARYs) when it sends * it to the database. * *

Implementation note: *
With org.postgresql, this creates a large object, and stores the * objects oid in this column. * * @param parameterIndex the first parameter is 1... * @param x the parameter value * @exception SQLException if a database access error occurs */ public void setBytes(int parameterIndex, byte x[]) throws SQLException { LargeObjectManager lom = connection.getLargeObjectAPI(); int oid = lom.create(); LargeObject lob = lom.open(oid); lob.write(x); lob.close(); setInt(parameterIndex,oid); }