/*
* @(#)BaseRowSet.java 1.15 06/07/10
*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package javax.sql.rowset;
import java.sql.*;
import javax.sql.*;
import java.util.*;
import java.io.*;
import java.math.*;
import java.io.Serializable;
import javax.sql.rowset.serial.*;
/**
* An abstract class providing a <code>RowSet</code> object with its basic functionality.
* The basic functions include having properties and sending event notifications,
* which all JavaBeans<sup><font size=-2>TM</font></sup> components must implement.
* <P>
* <h3>1.0 Overview</h3>
* The <code>BaseRowSet</code> class provides the core functionality
* for all <code>RowSet</code> implementations,
* and all standard implementations <b>may</b> use this class in combination with
* one or more <code>RowSet</code> interfaces in order to provide a standard
* vendor-specific implementation. To clarify, all implementations must implement
* at least one of the <code>RowSet</code> interfaces (<code>JdbcRowSet</code>,
* <code>CachedRowSet</code>, <code>JoinRowSet</code>, <code>FilteredRowSet</code>,
* or <code>WebRowSet</code>). This means that any implementation that extends
* the <code>BaseRowSet</code> class must also implement one of the <code>RowSet</code>
* interfaces.
* <p>
* The <code>BaseRowSet</code> class provides the following:
* <p>
* <UL>
* <LI><b>Properties</b>
* <ul>
* <li>Fields for storing current properties
* <li>Methods for getting and setting properties
* </ul>
* <p>
* <LI><b>Event notification</b>
* <P>
* <LI><b>A complete set of setter methods</b> for setting the parameters in a
* <code>RowSet</code> object's command
* <p>
* <LI> <b>Streams</b>
* <ul>
* <li>Fields for storing stream instances
* <li>Constants for indicating the type of a stream
* </ul>
* <p>
* </UL>
*
* <h3>2.0 Setting Properties</h3>
* All rowsets maintain a set of properties, which will usually be set using
* a tool. The number and kinds of properties a rowset has will vary,
* depending on what the <code>RowSet</code> implementation does and how it gets
* its data. For example,
* rowsets that get their data from a <code>ResultSet</code> object need to
* set the properties that are required for making a database connection.
* If a <code>RowSet</code> object uses the <code>DriverManager</code> facility to make a
* connection, it needs to set a property for the JDBC URL that identifies the
* appropriate driver, and it needs to set the properties that give the
* user name and password.
* If, on the other hand, the rowset uses a <code>DataSource</code> object
* to make the connection, which is the preferred method, it does not need to
* set the property for the JDBC URL. Instead, it needs to set the property
* for the logical name of the data source along with the properties for
* the user name and password.
* <P>
* NOTE: In order to use a <code>DataSource</code> object for making a
* connection, the <code>DataSource</code> object must have been registered
* with a naming service that uses the Java Naming and Directory
* Interface<sup><font size=-2>TM</font></sup> (JNDI) API. This registration
* is usually done by a person acting in the capacity of a system administrator.
* <P>
* <h3>3.0 Setting the Command and Its Parameters</h3>
* When a rowset gets its data from a relational database, it executes a command (a query)
* that produces a <code>ResultSet</code> object. This query is the command that is set
* for the <code>RowSet</code> object's command property. The rowset populates itself with data by reading the
* data from the <code>ResultSet</code> object into itself. If the query
* contains placeholders for values to be set, the <code>BaseRowSet</code> setter methods
* are used to set these values. All setter methods allow these values to be set
* to <code>null</code> if required.
* <P>
* The following code fragment illustrates how the
* <code>CachedRowSet</code><sup><font size=-2>TM</font></sup>
* object <code>crs</code> might have its command property set. Note that if a
* tool is used to set properties, this is the code that the tool would use.
* <PRE>
* crs.setCommand("SELECT FIRST_NAME, LAST_NAME, ADDRESS FROM CUSTOMERS" +
* "WHERE CREDIT_LIMIT > ? AND REGION = ?");
* </PRE>
* <P>
* In this example, the values for <code>CREDIT_LIMIT</code> and
* <code>REGION</code> are placeholder parameters, which are indicated with a
=1= |