Re: Queries with large ResultSets
От | Andrea Aime |
---|---|
Тема | Re: Queries with large ResultSets |
Дата | |
Msg-id | 200405210814.58303.andrea.aime@aliceposta.it обсуждение исходный текст |
Ответ на | Re: Queries with large ResultSets (Oliver Jowett <oliver@opencloud.com>) |
Список | pgsql-jdbc |
Alle 00:54, venerdì 21 maggio 2004, Oliver Jowett ha scritto: > Andrea Aime wrote: ... > I don't think you want a holdable cursor for this case anyway since the > backend would end up doing a lot of unnecessary copying results around. > If you're accessing big quantities of data, the overhead of an explicit > commit() after you're done with the resultset is going to be > insignificant compared to the cost of actually transferring and handling > that data. Use something like this: > > connection.setAutoCommit(false); > PreparedStatement stmt = connection.prepareStatement("SELECT ...."); > ResultSet rs = stmt.executeQuery(); > while (rs.next()) { > // process data > } > rs.close(); > connection.commit(); > > -O I see... well, that's what I will need to do it seems. Thank you for the advice :-) Best regards Andrea Aime
В списке pgsql-jdbc по дате отправления: