ResultSet usage and resultset usage
ResultSet usage highlights
The ResultSet is an object returned by the query results in the data. It can be said that the result set is an object that stores the query results, but the result set not only has the
Original link address this article does not give a specific example of how to use resultset, but only from the resultset of the functional features of the detailed narration. I hope this article will help you understand resultset. The following is
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
I remember writing an article before, but it seems to be a problem. It should be the number of columns. Here, I will correct myself and record it, because I will always forget it, I used it today, so I quickly sent it...
CodeAs follows:
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.
First, use the getRow method of the ResultSet to obtain the total number of rows of the ResultSet.
Statement stmt = con. createStatement (ResultSet. TYPE_SCROLL_INSENSITIVE, ResultSet. CONCUR_UPDATABLE );ResultSet rset = stmt.exe cuteQuery ("select
When we perform a database query to return a resultset, in many cases we need to know the size of the resultset, which is the number of rows and columns. We know that the number of columns can be easily obtained by Resultset.getmetadata ().
The result set (ResultSet) is an object returned by the query results in the data, which can be said that the result set is an object that stores the results of the query, but the result set does not only have the function of storage, but also has
The result set (ResultSet) is an object returned by the query results in the data, which can be said that the result set is an object that stores the results of the query, but the result set does not only have the function of storage, but also has
The result set (ResultSet) is an object returned by the query results in the data, which can be said that the result set is an object that stores the results of the query, but the result set does not only have the function of storage, but also has
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.