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

2002-10-16 Thread snpe
This code work for me : Connection db = DriverManager.getConnection(url,user,passwd); PreparedStatement st = db.prepareStatement("begin;declare c1 cursor for select * from a"); st.execute(); st = db.prepareStatement("fetch 100 in c1"); ResultSet rs = st.exe

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

2002-10-16 Thread Dave Tenny
> > > > 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.exe

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

2002-10-11 Thread snpe
Can You do this : We save 1000 (or fetchSize rows) first from beginning If table have < 1000 rows we save all rows, but if table have more rows and user request 1001 we fetch 1000 (again from begining, but skip 1000 rows or maybe continue fetching, if it possible) When user request last w

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

2002-10-11 Thread snpe
Hello, Does it mean that psql uses cursors ? regards Haris Peco On Friday 11 October 2002 05:58 pm, Dave Cramer wrote: > This really is an artifact of the way that postgres gives us the data. > > When you query the backend you get *all* of the results in the query, > and there is no indication

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

2002-10-11 Thread snpe
Barry, Is it true ? I create table with one column varchar(500) and enter 1 milion rows with length 10-20 character.JDBC query 'select * from a' get error 'out of memory', but psql not. I insert 8 milion rows and psql work fine yet (slow, but work) In C library is 'execute query' without fetch