5-resultset
This overview is taken from jdbctm database access from javatm: a tutorial and annotated reference. Javasoft is currently preparing this book. This is a tutorial and an important reference manual for JDBC, which will be published by
With JDBC (including Oracle jdbc extensions), there is no direct (or standard) method to use ResultSet or RowSet to get the number of rows returned by the query. However, you can use scrollable ResultSet or Cached RowSet with very few lines of code
Detailed description of the Java resultset Interface
Record set Interface
In jdbc api 2.0, the resultset interface has changed a lot, adding a lot of new methods for Row Operations and row location, with strong functionality
The major changes are
When we execute a database query and return a resultset, we need to know the size of this resultset in many cases, that is, its number of rows and number of columns. We know that the number of columns can be easily obtained through resultset.
Recently in the processing DB2, the query, found the following problems. If a query is count (*), there are hundreds of thousands of rows, how pagination is implementedSelect Row_number () over (order by FID desc ) as Row_number, Other_fieldFrom
The resultset API in JDBC does not directly obtain the number of records. Here we will introduce several methods: Method 1: Use the getrow method of resultset to obtain the total number of rows of resultset. Java code: resultset RS; RS. last (); //
Scrollable result set 1)Com.microsoft.sqlserver.jdbc.SQLServerException: The requested operation is not supported for a forward-only result set. When TYPE is set to:resultset.type_forward_only (default), the cursor cannot be moved arbitrarily, but
Tag: exec count () performs a span by querying the specified send NECDriverManager (basic service for managing a set of JDBC drivers)It's method: getConnection(String url, String user, String password) .Connection (connection to a specific
to use Redis as a MySQL database cache, 2 issues must be resolved. First, you should determine what data structure is used to store your MySQL-based information, and after determining the data structure, consider what identity is used as the key to
Important NOTE: this part of the article is the owner of the collection from the Internet, and if you think that the content of the document violates your rights, please contact the collation (excelarthur@yahoo.com.cn), and Dev2dev site has nothing
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.