pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Re: pgsql-interfaces-digest V1 #208
4+ messages / 2 participants
[nested] [flat]

* Re: pgsql-interfaces-digest V1 #208
@ 1999-01-28 23:34 Reto Gmuer <gmuer@netiquette.ch>
  1999-01-29 00:14 ` Re: [INTERFACES] Re: pgsql-interfaces-digest V1 #208 Peter T Mount <peter@retep.org.uk>
  0 siblings, 1 reply; 4+ messages in thread

From: Reto Gmuer @ 1999-01-28 23:34 UTC (permalink / raw)
  To: pgsql-interfaces@hub.org

I'm trying to insert a large object in my database with JDBC, as described in postgres/jdbc19181.htm.
I get this exception:

 InputStream as parameter not supported
 at postgresql.PreparedStatement.setBinaryStream(PreparedStatement.java:409)
 at postgresql.PreparedStatement.setAsciiStream(PreparedStatement.java:370)
 at com.solidj.dbutil.CopyTable.main(CopyTable.java:246)
 at sun.jws.Debugger.MainThread.run(AgentHandler.java:694)

What does this mean?
Reto

Attachments:

gmuer.vcf (text/x-vcard, 296B) download begin:vcard n:Gmuer;Reto tel;fax:+41 1 299 99 01 tel;work:+41 1 299 99 00 x-mozilla-html:TRUE url:http://www.netiquette.ch org:netiquette internet consulting adr:;;Hohlstrasse 190;Zurich;ZH;8004;Switzerland version:2.1 email;internet:gmuer@netiquette.ch x-mozilla-cpt:;-1 fn:Reto Gmuer end:vcard
^ permalink raw reply [nested|flat] 4+ messages in thread

* Re: [INTERFACES] Re: pgsql-interfaces-digest V1 #208
  1999-01-28 23:34 Re: pgsql-interfaces-digest V1 #208 Reto Gmuer <gmuer@netiquette.ch>
@ 1999-01-29 00:14 ` Peter T Mount <peter@retep.org.uk>
  1999-01-29 15:56   ` Re: [INTERFACES] Re: pgsql-interfaces-digest V1 #208 Reto Gmuer <gmuer@netiquette.ch>
  0 siblings, 1 reply; 4+ messages in thread

From: Peter T Mount @ 1999-01-29 00:14 UTC (permalink / raw)
  To: Reto Gmuer <gmuer@netiquette.ch>; +Cc: pgsql-interfaces@hub.org

On Fri, 29 Jan 1999, Reto Gmuer wrote:

> I'm trying to insert a large object in my database with JDBC, as described in postgres/jdbc19181.htm.
> I get this exception:
> 
>  InputStream as parameter not supported
>  at postgresql.PreparedStatement.setBinaryStream(PreparedStatement.java:409)
>  at postgresql.PreparedStatement.setAsciiStream(PreparedStatement.java:370)
>  at com.solidj.dbutil.CopyTable.main(CopyTable.java:246)
>  at sun.jws.Debugger.MainThread.run(AgentHandler.java:694)
> 
> What does this mean?
> Reto

Reading from or writing to a large object using Streams are not yet
supported. It's one of the things I have on my list for 6.5.

Peter

-- 
       Peter T Mount peter@retep.org.uk
      Main Homepage: http://www.retep.org.uk
PostgreSQL JDBC Faq: http://www.retep.org.uk/postgres
 Java PDF Generator: http://www.retep.org.uk/pdf




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: [INTERFACES] Re: pgsql-interfaces-digest V1 #208
  1999-01-28 23:34 Re: pgsql-interfaces-digest V1 #208 Reto Gmuer <gmuer@netiquette.ch>
  1999-01-29 00:14 ` Re: [INTERFACES] Re: pgsql-interfaces-digest V1 #208 Peter T Mount <peter@retep.org.uk>
@ 1999-01-29 15:56   ` Reto Gmuer <gmuer@netiquette.ch>
  1999-02-01 13:32     ` Re: [INTERFACES] Re: pgsql-interfaces-digest V1 #208 Peter T Mount <peter@retep.org.uk>
  0 siblings, 1 reply; 4+ messages in thread

From: Reto Gmuer @ 1999-01-29 15:56 UTC (permalink / raw)
  To: Peter T Mount <peter@retep.org.uk>; +Cc: pgsql-interfaces@hub.org

I should put large (> 8K)  text field into the database, do I have to put these in fields of type oid using the "Postgres Extensions to the JDBC API". Does this work?

Reto

Peter T Mount wrote:

>
> Reading from or writing to a large object using Streams are not yet
> supported. It's one of the things I have on my list for 6.5.
>
> Peter

--
Reto Gmuer
netiquette internet consulting, Zurich





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: [INTERFACES] Re: pgsql-interfaces-digest V1 #208
  1999-01-28 23:34 Re: pgsql-interfaces-digest V1 #208 Reto Gmuer <gmuer@netiquette.ch>
  1999-01-29 00:14 ` Re: [INTERFACES] Re: pgsql-interfaces-digest V1 #208 Peter T Mount <peter@retep.org.uk>
  1999-01-29 15:56   ` Re: [INTERFACES] Re: pgsql-interfaces-digest V1 #208 Reto Gmuer <gmuer@netiquette.ch>
@ 1999-02-01 13:32     ` Peter T Mount <peter@retep.org.uk>
  0 siblings, 0 replies; 4+ messages in thread

From: Peter T Mount @ 1999-02-01 13:32 UTC (permalink / raw)
  To: Reto Gmuer <gmuer@netiquette.ch>; +Cc: pgsql-interfaces@hub.org

On Fri, 29 Jan 1999, Reto Gmuer wrote:

> I should put large (> 8K)  text field into the database, do I have to
> put these in fields of type oid using the "Postgres Extensions to the
> JDBC API". Does this work?

To put in any data >8K, you would need to use the LargeObject API.

On the standard JDBC front, there's two methods of handling this:

The first is using the ResultSet.getBytes() and
PreparedStatement.setBytes() methods. These return the _entire_ object in
one go. For small objects, this isn't too bad, but for large ones, this
will cause problems (both speed and memory).

The second is using Streams, and this is not currently implemented in an
efficient manner. The ResultSet.getBinaryStream() is implemented, and it
simply calls getBytes(), and creates a ByteArrayInputStream from the
object.

The PreparedStatement.setBinaryStream() methods are not implemented at
all.

Finally, the Ascii & Unicode stream methods simply pass through to the
BinaryStream methods.

The methods in the Extensions, ie the InputStream & OutputStream's on a
large object are intended to fill in the gaps. I'm hoping to have them
read small chunks of a LargeObject, and buffer them. Then, the stream
based methods in ResultSet and PreparedStatement would use them instead,
and this should improve efficiency with very large objects.

> Peter T Mount wrote:
> 
> >
> > Reading from or writing to a large object using Streams are not yet
> > supported. It's one of the things I have on my list for 6.5.
> >
> > Peter
> 
> --
> Reto Gmuer
> netiquette internet consulting, Zurich

-- 
       Peter T Mount peter@retep.org.uk
      Main Homepage: http://www.retep.org.uk
PostgreSQL JDBC Faq: http://www.retep.org.uk/postgres
 Java PDF Generator: http://www.retep.org.uk/pdf




^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~1999-02-01 13:32 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-01-28 23:34 Re: pgsql-interfaces-digest V1 #208 Reto Gmuer <gmuer@netiquette.ch>
1999-01-29 00:14 ` Peter T Mount <peter@retep.org.uk>
1999-01-29 15:56   ` Reto Gmuer <gmuer@netiquette.ch>
1999-02-01 13:32     ` Peter T Mount <peter@retep.org.uk>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox