Home > Archive > PostgreSQL JDBC > September 2005 > Re: setting large bytea values









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: setting large bytea values
Oliver Jowett

2005-09-01, 8:24 pm

(I added a useful subject line..)

gurkan@resolution.com wrote:

> I have been working on conversion program from Informix to PostgreSQL db, and I
> have a one table which has large data(bytea).
>
> I need to be able to copy this one row (docdata column) that I have which is
> close to 32MB. Program seems to read the data but cannot copy to postgres
> (PreparedStatement),
it gives OutOfMemoryError. I ran the program with these
> heap too.
> java -Xms200m -Xmx700m AddDoc


What driver and server versions are you using? 8.0 drivers against a 7.4
or later server should handle this fine with no extra intermediate
copies of the stream.

> inp = new ByteArrayInputStream
(wbout.toByteArray());

[...]
> postgresStmt.setBinaryStream (2, inp, inp.available());


You could also use setBytes() directly here, but either way should work.

-O

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com