Re: [JDBC] Out of memory error on huge resultset

Поиск
Список
Период
Сортировка
От Dave Tenny
Тема Re: [JDBC] Out of memory error on huge resultset
Дата
Msg-id 20021016115515.PZLP11063.rwcrmhc52.attbi.com@there
обсуждение исходный текст
Ответы Re: [JDBC] Out of memory error on huge resultset  (snpe <snpe@snpe.co.yu>)
Список pgsql-hackers
> > > > To work
> > > > around this you can use explicit cursors (see the DECLARE CURSOR,
> > > > FETCH, and MOVE sql commands for postgres).

I'm unable to get this to work using the default distribution JDBC driver. 
(7.2). Here's a code snippet
     conn.setAutoCommit(false) ;     stmt.execute("BEGIN") ;     stmt.execute("DECLARE mysursor CURSOR FOR SELECT icol
FROMmtable") ;     ResultSet rs = null ;     if (stmt.execute("FETCH 10000 IN mycursor"))rs = stmt.getResultSet() ;
 

The FETCH statement returns an update count of 1, but no ResultSet.
If I try executeQuery, a "no rows found" exception is thrown.

Equivalent code in the C library interface works just fine.

I need a workaround, because default ResultSet processing in the JDBC
driver (and also the jxDBCon driver) pretty much blow out the memory 
of the JVM. 


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Denis A Ustimenko
Дата:
Сообщение: Re: droped out precise time calculations in src/interfaces/libpq/fe-connect.c
Следующее
От: snpe
Дата:
Сообщение: Re: [JDBC] Out of memory error on huge resultset