Thread: pg703: support for Large objects via JDBC PreparedStatement.setBi naryStream()

pg703: support for Large objects via JDBC PreparedStatement.setBi naryStream()

From
Julian Richardson
Date:
Hi all,

maybe this one's been asked before but I've just found this list (if it's
archived & searchable someplace then let me know)

I just installed Postgres 7.0.3 the other day (Redhat 7.0) and was trying to
insert binary data into the DB via JDBC using the standard
PreparedStatement.setBinaryStream() method, but the JDBC driver wasn't
having any of it. Taking a look at the source code shows it as not being
implemented yet, at least in the drivers I have.

I didn't study the code in detail but it looked like there's stuff missing
in the Large Objects API too, so it may not even be possible to use that as
an alternative (I'd rather not anyway, but may have been able to make the
setBinaryStream method call into it behind the scenes to do the work)

Is there a workaround for this (or preferably a fix for the drivers!!) - or
does it work in pg6.5 as downgrading may be an option?

cheers,

Jules

ps. posted a variation on this to the pgsql-bugs list the other day but
don't know if it got through - hopefully this one will.

Quoting Julian Richardson <JRichardson@softwright.co.uk>:

> I didn't study the code in detail but it looked like there's stuff
> missing
> in the Large Objects API too, so it may not even be possible to use that
> as
> an alternative (I'd rather not anyway, but may have been able to make
> the
> setBinaryStream method call into it behind the scenes to do the work)
>
> Is there a workaround for this (or preferably a fix for the drivers!!) -
> or
> does it work in pg6.5 as downgrading may be an option?

No, proper stream support was only introduced in 7.1 :-)

> ps. posted a variation on this to the pgsql-bugs list the other day but
> don't know if it got through - hopefully this one will.

I've been ofline for a couple of weeks so I've got a few K of emails to catch
up with :-(

Peter

--
Peter Mount peter@retep.org.uk
PostgreSQL JDBC Driver: http://www.retep.org.uk/postgres/
RetepPDF PDF library for Java: http://www.retep.org.uk/pdf/