Open SQLResultSet [message #1059737] |
Tue, 21 May 2013 09:09  |
Eclipse User |
|
|
|
Is it possible to obtain the record count from an SQLResultSet?
I've developed a simple search facility over an IBM i database table using EDT and it's working really well. I use the prepare statement and then the get statement.
However, I need to get more sophisticated as the get statement is returning a large number of records, which on occasion returns a CRRUI3660E (Could not convert from JSON format), which I believe is caused by the large amount of data being returned.
So, what I'd like to do instead is open an sql result set and then read a block of records, say 100 at a time, but it would be really helpful to display the record count based on the search criteria.
The only way I can think of doing this is to issue a an sql 'select count' statement first, but was hoping that the SQLResultSet included some information about the result set that is built.
Richard
|
|
|
|
|
Re: Open SQLResultSet [message #1060992 is a reply to message #1060908] |
Wed, 29 May 2013 09:08  |
Eclipse User |
|
|
|
Hi Trond,
I think that the getSize() function applies to the array of records returned from a service but this causes me a problem as in my instance the result set can contain a large number of records, which blows the limit of data that can be handled by the client layer.
So, my solution is working at the server level only returning a small subset of the result set (say 50 records), though back at the client level I want to know how many records are in that result set to help with paging controls.
So, the following code does work quite well (in my service).
// Obtain the row count
resultSet.setLast();
listControl.rowCount = resultSet.getPosition();
However, what I don't believe I can do is to keep a result set open and make multiple calls to the server to obtain the next block of 50 records. I'd be interested to hear how are other people are handling large result sets in a RUI application?
Richard
|
|
|
Powered by
FUDForum. Page generated in 0.03696 seconds