@SuppressWarnings("deprecation")
    private void decodeParams(Object[] params,
                              PreparedStatement pstmt) throws SQLException {
    // There is a corresponding decodeParams in JdbcRowSetImpl
    // which does the same as this method. This is a design flaw.
    // Update the JdbcRowSetImpl.decodeParams when you update
    // this method.

    // Adding the same comments to JdbcRowSetImpl.decodeParams.

        int arraySize;
        Object[] param = null;

        for (int i=0; i < params.length; i++) {
            if (params[i] instanceof Object[]) {
                param = (Object[])params[i];

                if (param.length == 2) {
                    if (param[0] == null) {
                        pstmt.setNull(i + 1, ((Integer)param[1]).intValue());
                        continue;
                    }

                    if (param[0] instanceof Date ||
                        param[0] instanceof Time ||
                        param[0] instanceof Timestamp) {
                        System.err.println(resBundle.handleGetObject("crsreader.datedetected").toString());
                        if (param[1] instanceof java.util.Calendar) {
                            System.err.println(resBundle.handleGetObject("crsreader.caldetected").toString());
                            pstmt.setDate(i + 1, (Date)param[0],
                                       (java.util.Calendar)param[1]);
                            continue;
                        }
                        else {
                            throw new SQLException(resBundle.handleGetObject("crsreader.paramtype").toString());
                        }
                    }

                    if (param[0] instanceof Reader) {
                        pstmt.setCharacterStream(i + 1, (Reader)param[0],
                                              ((Integer)param[1]).intValue());
                        continue;
                    }

                    /*
                     * What's left should be setObject(int, Object, scale)
                     */
                    if (param[1] instanceof Integer) {
                        pstmt.setObject(i + 1, param[0], ((Integer)param[1]).intValue());
                        continue;
                    }

                } else if (param.length == 3) {

                    if (param[0] == null) {
                        pstmt.setNull(i + 1, ((Integer)param[1]).intValue(),
                                   (String)param[2]);
                        continue;
                    }

                    if (param[0] instanceof InputStream) {
                        switch (((Integer)param[2]).intValue()) {
                        case CachedRowSetImpl.UNICODE_STREAM_PARAM:
                            pstmt.setUnicodeStream(i + 1,
                                                (InputStream)param[0],
                                                ((Integer)param[1]).intValue());
                            break;
                        case CachedRowSetImpl.BINARY_STREAM_PARAM:
                            pstmt.setBinaryStream(i + 1,
                                               (InputStream)param[0],
                                               ((Integer)param[1]).intValue());
                            break;
                        case CachedRowSetImpl.ASCII_STREAM_PARAM:
                            pstmt.setAsciiStream(i + 1,
                                              (InputStream)param[0],
                                              ((Integer)param[1]).intValue());
                            break;
                        default:
                            throw new SQLException(resBundle.handleGetObject("crsreader.paramtype").toString());
                        }
                    }

                    /*
                     * no point at looking at the first element now;
                     * what's left must be the setObject() cases.
                     */
                    if (param[1] instanceof Integer && param[2] instanceof Integer) {
                        pstmt.setObject(i + 1, param[0], ((Integer)param[1]).intValue(),
                                     ((Integer)param[2]).intValue());
                        continue;
                    }

                    throw new SQLException(resBundle.handleGetObject("crsreader.paramtype").toString());

                } else {
                    // common case - this catches all SQL92 types
                    pstmt.setObject(i + 1, params[i]);
                    continue;
                }
            }  else {
               // Try to get all the params to be set here
               pstmt.setObject(i + 1, params[i]);

            }
        }
    }
Sets the parameter placeholders
in the rowset's command (the given <code>PreparedStatement</code>
object) with the parameters in the given array.
This method, called internally by the method
<code>CachedRowSetReader.readData</code>, reads each parameter, and
based on its type, determines the correct
<code>PreparedStatement.setXXX</code> method to use for setting
that parameter.

@param params an array of parameters to be used with the given
              <code>PreparedStatement</code> object
@param pstmt  the <code>PreparedStatement</code> object that is the
              command for the calling rowset and into which
              the given parameters are to be set
@throws SQLException if an access error occurs
src/main/java/org/replicadb/rowset/sun/rowset/internal/CachedRowSetReader.java