When creating with default settings, ResultSet is only one-time-tHrough that can only access (Forward-only) and read-only objects. You can only access the data once, if you need this data again, you must re-query the database.
However, there is not only this way. By setting parameters on the Statement object, you can control the resultSet it produces. E.g:
...
Class.Forname (drivername);
DB = DriverManager.getConnection (connectURL);
Statement Statement = DB.CREATESTATEMENT (
ResultSet.Type_Scroll_Sensitive,
ResultSet.concur_UpDataBLE
);
String OrdeerLname = XmlfileEl.GetElementsBytagname ("ORDER"). Item (0)
Getfirstchild (). getnodevalue ();
...
This Statement will now generate RESULTSETs that can be updated and changed by other database users. You can also move forward and backward in this RESULTSET.
The first parameter specifies the type of ResultSet. Its options are:
TYPE_FORWARD_ONLY: The default type. Only allowed access to one time and will not be affected by other users to make changes to the database.
TYPE_SCROLL_INSENSITIVE: Allows to move forward or rearward in the list, and can even perform specific positioning, such as moving to the fourth record in the list or two records from the current position backward. It is not affected by other users to make changes to the database.
TYPE_SCROLL_SENSITIVE: Like type_scroll_insensitive, it is allowed to be positioned in the record. This type is affected by other users. If the user deletes a record after executing the query, that record will disappear from the ResultSet. Similarly, changes to data values will also be reflected in the ResultSet.
The second parameter sets the concurrency of the ResultSet, which determines if the ResultSet can be updated. Its options are:
Concur_read_only: This is the default value, specify that you can't update ResultSet
Concur_updata: Specifying RESULTSET