Re: Synthesize support for Statement.getGeneratedKeys()? - Mailing list pgsql-jdbc

From Ken Johanson
Subject Re: Synthesize support for Statement.getGeneratedKeys()?
Date
Msg-id 45BCC675.5050000@kensystem.com
Whole thread Raw
In response to Re: Synthesize support for Statement.getGeneratedKeys()?  (Kris Jurka <books@ejurka.com>)
List pgsql-jdbc
>> In implementing Statement.executeUpdate(String sql,String[]
>> columnNames), does any know how I could go about sending the sql and
>> subsequent RETURNING clause directly to a stream? Just so I can avoid
>> double-buffering the query (allocated in the sql, and second in the
>> StringBuffer I'd be appending the RETURNING clause to).
>
> Don't worry about this minor overhead.  So much other manipulation and
> object creation happens (even forgetting the network trip) that this
> will be in the noise.
>


Hmm, this might be an area I'd enjoy contributing code for.. if there
are places now where there is avoidable double or triple allocation
(like in my patch) (where it could instead be handled by streams and/or
finer grained chunks), and since the driver (apparently) already has
some stream based utils... maybe I could try to improve those.

I know from experience with other tools that unnec allocation can play
havoc under high load and/or very large data sets, using (resizeable)
buffers (like StringBuffer). When that code gets optimized the
application becomes much more responsive.

If you know of any places in the driver that could benefit from this,
please let me know.

ken



pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: escape string for pgsql (using jdbc/java)?
Next
From: Thomas Kellerer
Date:
Subject: Strange result from DatabaseMetaData.getTablePrivileges()