Hello and thanks for the answer! I use the following code to create the statement and resultset:
java.sql.PreparedStatement stat = conn.prepareStatement(sqlQ, java.sql.ResultSet.CONCUR_READ_ONLY); stat.setFetchSize(5); java.sql.ResultSet res = stat.executeQuery(); So I don't think there is anything funny there. I have tried with a couple of fetchsizes ( 5, 50, 500 ) but it doesn't seem to do any difference. I also tested with TYPE_FORWARD_ONLY with no luck. Thanks in advance Roland Carlsson ----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, March 11, 2003 1:08 PM Subject: Re: Large resultset > > > > I have a query that returns a resultset of 70 mb. I'd somehow would like > > J/Connector to fetch only small pieces using Statement.setFetchSize but > it > > still get the whole ResultSet at once and then I get an OutOfMemoryError. > > > Is it a bug in setFetchSize? Does J/Connector ignore it? Have I totally > > missunderstood what setFetchSize does? > > It works for me, in a similar sort of situation. > > Is your Statement TYPE_FORWARD_ONLY and CONCUR_READ_ONLY? These are > defaults, but you may have overridden them, and if so you disable the > setFetchSize(). > > Do you call setFetchSize() before the query? If not, the query will fetch > it all, and it is no use setting it before you fetch results. > > > Alec > > > > --------------------------------------------------------------------- > Before posting, please check: > http://www.mysql.com/manual.php (the manual) > http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php