Please give suggestions
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Gabriel_Lo
Posted On:   Sunday, January 20, 2002 11:21 PM

I use DB2 Database, I don't know how to select certain rows from the DB, so I have used the Java vector to work as the pagination alogorithm. But my method is kinda stupid, so I would like to know if there are any other suggestion from you guys. What I am doing is:


RETRIEVE all the data from my Query, and then store in a Vector, then get the data from element 0 to 100 for the first page, 101 to 200 for the second page, etc....So my loading time is kinda slow. Is there any other suggestions??

Re: Please give suggestions

Posted By:   Anonymous  
Posted On:   Sunday, January 20, 2002 11:56 PM

Hi,

try to set the fetch size for ur resultset using the method in interface
ResultSet.



public void setFetchSize(int rows)


JDBC 2.0 Gives the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed for this result set.
If the fetch size specified is zero, the JDBC driver ignores the value
and is free to make its own best guess as to what the fetch size should be. The default value is set by the
statement that created the result set. The fetch size may be changed at any time.




Hope this info helps !!!



~vivek
About | Sitemap | Contact