Skip site navigation (1) Skip section navigation (2)

RE: JDBC driver writes binary data ONLY as Large Object

From: Peter Mount <petermount(at)it(dot)maidstone(dot)gov(dot)uk>
To: "'Bill'" <bouma(at)cplane(dot)com>, pgsql-interfaces(at)postgresql(dot)org
Subject: RE: JDBC driver writes binary data ONLY as Large Object
Date: 2000-08-02 08:00:19
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
The problem here is that there is no metadata available to check.

If the backend was able to precompile the query, then we would know the
column type, but as it stands currently there is no way of finding out what
the column type is.


Peter Mount
Enterprise Support
Maidstone Borough Council
Any views stated are my own, and not those of Maidstone Borough Council

-----Original Message-----
From: Bill [mailto:bouma(at)cplane(dot)com]
Sent: Tuesday, August 01, 2000 8:37 PM
To: pgsql-interfaces(at)postgresql(dot)org
Subject: [INTERFACES] JDBC driver writes binary data ONLY as Large

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 <bouma(at)cplane(dot)com>



   * 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.
   * <p>Implementation note:
   * <br>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 =;


pgsql-interfaces by date

Next:From: Oliver ElphickDate: 2000-08-02 09:09:10
Subject: Re: Re: And Furthermore. Was: PSQL Working, but PGAccess Not Connecting.
Previous:From: David Lloyd-JonesDate: 2000-08-02 06:54:25
Subject: Can't Find NSD8x and NDS76

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group