One of the new features in the JDBC 2.0 API is the ability to move a result set?s cursor backward as well as forward. There are also methods that let you move the cursor to a particular row and check the position of the cursor.
Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
ResultSet srs = stmt.executeQuery(?SELECT COF_NAME, PRICE FROM COFFEES?);
The first argument is one of three constants added to the ResultSet API to indicate the type of a ResultSet object: TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE , and TYPE_SCROLL_SENSITIVE. The second argument is one of two ResultSet constants for specifying whether a result set is read-only or updatable: CONCUR_READ_ONLY and CONCUR_UPDATABLE. The point to remember here is that if you specify a type, you must also specify whether it is read-only or updatable. Also, you must specify the type first, and because both parameters are of type int , the compiler will not complain if you switch the order. Specifying the constant TYPE_FORWARD_ONLY creates a nonscrollable result set, that is, one in which the cursor moves only forward. If you do not specify any constants for the type and updatability of a ResultSet object, you will automatically get one that is TYPE_FORWARD_ONLY and CONCUR_READ_ONLY.
| Answered By : |
null Replied Date : Mar 31 2012 |
| Answer : |
|
| Answered By : |
null Replied Date : Feb 5 2012 |
| Answer : |
|
| Answered By : |
null Replied Date : Jan 15 2012 |
| Answer : |
|
| Answered By : |
null Replied Date : Dec 31 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Nov 16 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Nov 13 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Nov 2 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Nov 1 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Sep 18 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Aug 6 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Jun 22 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Jun 17 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : May 28 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Apr 24 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Mar 25 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Mar 5 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Feb 22 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Feb 20 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Jan 23 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Jan 23 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Jan 15 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Dec 27 2010 |
| Answer : |
|
| Answered By : |
null Replied Date : Nov 22 2010 |
| Answer : |
|
| Answered By : |
null Replied Date : Nov 12 2010 |
| Answer : |
|
| Answered By : |
null Replied Date : Nov 6 2010 |
| Answer : |
|
| Answered By : |
null Replied Date : Sep 11 2010 |
| Answer : |
|
| Answered By : |
null Replied Date : Sep 10 2010 |
| Answer : |
|
| Answered By : |
null Replied Date : Sep 9 2010 |
| Answer : |
|
| Answered By : |
null Replied Date : Sep 8 2010 |
| Answer : |
|
| Answered By : |
null Replied Date : Sep 3 2010 |
| Answer : |
|
| Answered By : |
null Replied Date : Aug 10 2010 |
| Answer : |
|
| Answered By : |
null Replied Date : Apr 25 2012 |
| Answer : |
|
| Answered By : |
null Replied Date : May 21 2012 |
| Answer : |
|
| Answered By : |
null Replied Date : Jun 29 2012 |
| Answer : |
|
| Answered By : |
null Replied Date : Jul 29 2012 |
| Answer : |
|
| Answered By : |
null Replied Date : Jul 30 2012 |
| Answer : |
|
| Answered By : |
null Replied Date : Sep 11 2012 |
| Answer : |
|
| Answered By : |
null Replied Date : Sep 24 2012 |
| Answer : |
|
| Answered By : |
null Replied Date : Oct 10 2012 |
| Answer : |
|
| Answered By : |
null Replied Date : Nov 9 2012 |
| Answer : |
|
| Answered By : |
null Replied Date : Feb 17 2013 |
| Answer : |
|
| Answered By : |
null Replied Date : Feb 17 2013 |
| Answer : |
|
| Answered By : |
null Replied Date : Feb 19 2013 |
| Answer : |
|
| Answered By : |
null Replied Date : Apr 26 2013 |
| Answer : |
|
| Answered By : |
null Replied Date : Apr 27 2013 |
| Answer : |
|