Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can resultset records be restricted to certain rows?

certain records ResultSet rows
0
Posted

How can resultset records be restricted to certain rows?

0

Location: http://www.jguru.com/faq/view.jsp?EID=15644 Created: Feb 18, 2000 Modified: 2000-02-19 04:19:02.43 Author: Govind Seshadri (http://www.jguru.com/guru/viewbio.jsp?EID=14) The easy answer is “Use a JDBC 2.0 compliant driver”. With a 2.0 driver, you can use the setFetchSize() method within a Statement or a ResultSet object. For example, Statement stmt = con.createStatement(); stmt.setFetchSize(400); ResultSet rs = stmt.executeQuery(“select * from customers”); will change the default fetch size to 400. You can also control the direction in which the rows are processed. For instance: stmt.setFetchDirection(ResultSet.FETCH_REVERSE) will process the rows from bottom up. The driver manager usually defaults to the most efficient fetch size…so you may try experimenting with different value for optimal performance.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123