Rowset usage in Java

Source: Internet
Author: User
Compared to ResultSet, the rowset default is scrollable, updatable, serializable result sets. and used as JavaBean. Therefore, it can be conveniently transmitted on the network. Used to synchronize data at both ends. For offline rowset, when the program creates the rowset, it has read the data from the database to memory, so it can take full advantage of the computer's memory. Thus reducing the load on the server.
JAVA7 provides a rowsetprovider that can be used to obtain Rowsetfactory objects using the Rowsetprovider.newfactory () method. There are five commonly used methods in Rowsetfactory to obtain an instance of rowset. respectively: CachedRowSet createcachedrowset (); Webrowset Createwebrowset (); Joinrowset Createjoinrowset (); Fileterrowset Createfilterrowset (); Jdbcrowset Createjdbcrowset (); The rowset interface defines several common methods: SetUrl (String URL); Setusername (String name); SetPassword (String password); SetCommand (String sql); Execute (); Populate (Result R); From the above method, you can see that there are two ways to populate rowset with data: A good ResultSet is created, and populate (ResultSet) is passed to rowset, URLs, and so on, to rowset and execute SQL with execute. An important property of rowset is that it has interfaces in its sub-interfaces that can be implemented offline, such as CachedRowSet and its sub-interfaces: its sub-interfaces have webrowset,webrowset and sub-interfaces Filteredrowset,joinrowset
Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.