I'm trying to render a list of records in a jsf page with a query that returns many records, I'm using weblogic 10.3.0.0 and sql server driver 4 from Microsoft to connect a sql server database, when I run this jsf page, this consumes a lot of memory because the query returns many record and therefore a OutOfMemoryError is occurring. I've seen that with setFetchSize you can limit the results, but here:
What does Statement.setFetchSize(nSize) method really do in SQL Server JDBC driver?
the microsoft's sql server driver not limit this, I used jDTS driver as the above post has suggested, but the same problem ocurre, I've also tried to use this:
http://msdn.microsoft.com/en-us/library/bb879937.aspx
for use adaptive buffering with the driver, but my driver version is 4 so this by default has adaptive buffering, but apparently no, I've tried this:
statement = connectionDB.createStatement();
SQLServerStatement SQLstmt = (SQLServerStatement) statement;
SQLstmt.setResponseBuffering("adaptive");
but this no returns results, I've put this in the connection properties also, but the problem still occure, I understand that the problem is the query have big results and the driver no execute it with chunks, and therefore the memory is decreasing, and I believe that this is the problem. I don't know who workaround use, if do the manual pagination with the query, if use another driver, etc., please help me to find a workaround, whatever info is well received, sorry for my poor english