Re: JDBC Streaming large objects - Mailing list pgsql-jdbc

From Barry Lind
Subject Re: JDBC Streaming large objects
Date
Msg-id 3F62753B.5030802@xythos.com
Whole thread Raw
In response to JDBC Streaming large objects  ("Kevin Schroeder" <kschroeder@mirageworks.com>)
List pgsql-jdbc
Kevin,

Can you give an example of what you are trying to do?  Is it the text of
the query that is too large to hold in memory, or is the the values that
are being bound that make it too large?

I am not sure that the jdbc spec works well for you.  Since even if you
are using PreparedStatements, you need to have all the values in memory
when you call setXXX(), since until execute() is called the SQL can't be
sent to the server, and these values can't be freed and garbage collected.

thanks,
--Barry




Kevin Schroeder wrote:
> Hello,
>     I was wondering if the PostgreSQL JDBC driver has the ability to stream
> an SQL query to PostgreSQL.  Looking at the archive it seems as though that
> functionality is not there.  I'm writing a program that needs to have the
> ability to generate the SQL query on the fly because there will be occasions
> where the INSERT statements will be larger than the available memory.  If
> this functionality is not yet available it means that I'll have to make some
> modifications to the JDBC driver but I'd rather not do that if there is a
> method of streaming the query already out there.  I also probably don't know
> what I'm getting into if I were to try rewriting portions of the driver.
>
>     So, if anyone knows if there is a way to stream data via an INSERT
> statement without running into the OutOfMemoryError I'd love to hear it.
>
> Thanks
> Kevin Schroeder
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
>       joining column's datatypes do not match
>




pgsql-jdbc by date:

Previous
From: Barry Lind
Date:
Subject: Re: Bug #814
Next
From: Barry Lind
Date:
Subject: Re: Specification of "/" in the host name (for Unix socket