private String buildWhereClause(String whereClause,
                                    ResultSet rs) throws SQLException {
        whereClause = "WHERE ";

        for (int i = 0; i < keyCols.length; i++) {
            if (i > 0) {
                    whereClause += "AND ";
            }
            whereClause += callerMd.getColumnName(keyCols[i]);
            params[i] = rs.getObject(keyCols[i]);
            if (rs.wasNull() == true) {
                whereClause += " IS NULL ";
            } else {
                whereClause += " = ? ";
            }
        }
        return whereClause;
    }
Constructs an SQL <code>WHERE</code> clause using the given
string as a starting point. The resulting clause will contain
a column name and " = ?" for each key column, that is, each column
that is needed to form a unique identifier for a row in the rowset.
This <code>WHERE</code> clause can be added to
a <code>PreparedStatement</code> object that updates, inserts, or
deletes a row.
<P>
This method uses the given result set to access values in the
<code>CachedRowSet</code> object that called this writer.  These
values are used to build the array of parameters that will serve as
replacements for the "?" parameter placeholders in the
<code>PreparedStatement</code> object that is sent to the
<code>CachedRowSet</code> object's underlying data source.

@param whereClause a <code>String</code> object that is an empty
                   string ("")
@param rs a <code>ResultSet</code> object that can be used
          to access the <code>CachedRowSet</code> object's data
@return a <code>WHERE</code> clause of the form "<code>WHERE</code>
        columnName = ? AND columnName = ? AND columnName = ? ..."
@throws SQLException if a database access error occurs
src/main/java/org/replicadb/rowset/sun/rowset/internal/CachedRowSetWriter.java