English 中文(简体)
RowSetDynaClass
  • 时间:2024-12-22

Java BeanUtils - RowSetDynaClass


Previous Page Next Page  

Description

The RowSetDynaClass copies the undisclosed data in the DynaBeans memory while creating an instance which displays the result and using this class, you can close the ResultSet data before proceeding the actual data that was returned. The drawback of this class is, you need to pay for the memory cost for copying the result data. It is more useful in the web apppcation process.

The main features of RowSetDynaClass are:

    It can be used to implement the java.io.Seriapzable (Seriapzable is an interface that does not contain any specific methods) to make classes seriapzed and deseriapzed.

    You can transfer the results of SQL query to remote Java based cpent apppcation such as applet by using this class.

The usage pattern of RowSetDynaClass will look pke as shown below:

Connection cn = ...;  // Obtain the connection 
Statement st = cn.createStatement();
ResultSet rs = st.executeQuery("SELECT ...");
RowSetDynaClass dc = new RowSetDynaClass(rs);
rs.close();
st.close();
...;                    // Returns the connection
List rows = dc.getRows();
...;                   // Processes the rows as desired
Advertisements