Re: Question 1 - This is straight out of the Java documentation:
A default ResultSet object is not updatable and has a cursor that moves
forward only. Thus, it is possible to iterate through it only once and only
from the first row to the last row. New methods in the JDBC 2.0 API make it
possible to produce ResultSet objects that are scrollable and/or updatable.
The following code fragment, in which con is a valid Connection object,
illustrates how to make a result set that is scrollable and insensitive to
updates by others, and that is updatable. See ResultSet fields for other
options.
Statement stmt = con.createStatement(
ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_UPDATABLE);
ResultSet rs = stmt.executeQuery("SELECT a, b FROM TABLE2");
// rs will be scrollable, will not show changes made by others,
// and will be updatable
Regards,
Mike Kelly
-----Original Message-----
From: Alarcon Fabio [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 28 September 2000 11:52
To: [EMAIL PROTECTED]
Subject: About JDBC
Hi friends
I need your help, please.
1. How can I set the ResultSet" scrollable?
2. What is more expensive to get the number of rows from a ResultSet?
a)
int rows = 0;
rs.last();
rows = rs.getRow();
rs.beforeFirst();
b) with "SELECT count(*) ..."
Suggestions please.
Thanks in advance
Best regards
Fabio Alarcon Ortiz
Seguro Social de Salud, Lima - Peru
Gerencia Central de Desarrollo e Informatica
Gerencia de Sistemas
Phones : (51 1) 265 6000, 265 7000 Extensions 2356, 2357
Mobile : (51 1) 855 1393
ICQ : 11002875
email : [EMAIL PROTECTED], [EMAIL PROTECTED]
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets