src/share/classes/javax/sql/rowset/BaseRowSet.java

Print this page




2372      * placeholder parameter, the array containing it will be the second element in
2373      * the array returned by <code>getParams</code>.
2374      * <P>
2375      * Note that because the numbering of elements in an array starts at zero,
2376      * the array element that corresponds to placeholder parameter number
2377      * <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.
2378      *
2379      * @param parameterIndex the ordinal number of the placeholder parameter
2380      *        in this <code>RowSet</code> object's command that is to be set.
2381      *        The first parameter is 1, the second is 2, and so on; must be
2382      *        <code>1</code> or greater
2383      * @param x the <code>java.io.InputStream</code> object that contains the
2384      *          UNICODE parameter value
2385      * @param length the number of bytes in the input stream
2386      * @throws SQLException if an error occurs, the parameter index is out of bounds,
2387      *         or the number of bytes the driver reads and sends to the database is
2388      *         not equal to the number of bytes specified in <i>length</i>
2389      * @deprecated getCharacterStream should be used in its place
2390      * @see #getParams
2391      */
2392 
2393     public void setUnicodeStream(int parameterIndex, java.io.InputStream x, int length) throws SQLException {
2394         Object unicodeStream[];
2395         checkParamIndex(parameterIndex);
2396 
2397         unicodeStream = new Object[3];
2398         unicodeStream[0] = x;
2399         unicodeStream[1] = Integer.valueOf(length);
2400         unicodeStream[2] = Integer.valueOf(UNICODE_STREAM_PARAM);
2401         if(params == null){
2402              throw new SQLException("Set initParams() before setUnicodeStream");
2403         }
2404         params.put(Integer.valueOf(parameterIndex - 1), unicodeStream);
2405     }
2406 
2407     /**
2408      * Sets the designated parameter to the given <code>java.io.Reader</code>
2409      * object, which will have the specified number of characters. The
2410      * contents of the reader will be read and sent to the database.
2411      * This method throws an <code>SQLException</code> if the number of bytes
2412      * read and sent to the database is not equal to <i>length</i>.




2372      * placeholder parameter, the array containing it will be the second element in
2373      * the array returned by <code>getParams</code>.
2374      * <P>
2375      * Note that because the numbering of elements in an array starts at zero,
2376      * the array element that corresponds to placeholder parameter number
2377      * <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.
2378      *
2379      * @param parameterIndex the ordinal number of the placeholder parameter
2380      *        in this <code>RowSet</code> object's command that is to be set.
2381      *        The first parameter is 1, the second is 2, and so on; must be
2382      *        <code>1</code> or greater
2383      * @param x the <code>java.io.InputStream</code> object that contains the
2384      *          UNICODE parameter value
2385      * @param length the number of bytes in the input stream
2386      * @throws SQLException if an error occurs, the parameter index is out of bounds,
2387      *         or the number of bytes the driver reads and sends to the database is
2388      *         not equal to the number of bytes specified in <i>length</i>
2389      * @deprecated getCharacterStream should be used in its place
2390      * @see #getParams
2391      */
2392     @Deprecated
2393     public void setUnicodeStream(int parameterIndex, java.io.InputStream x, int length) throws SQLException {
2394         Object unicodeStream[];
2395         checkParamIndex(parameterIndex);
2396 
2397         unicodeStream = new Object[3];
2398         unicodeStream[0] = x;
2399         unicodeStream[1] = Integer.valueOf(length);
2400         unicodeStream[2] = Integer.valueOf(UNICODE_STREAM_PARAM);
2401         if(params == null){
2402              throw new SQLException("Set initParams() before setUnicodeStream");
2403         }
2404         params.put(Integer.valueOf(parameterIndex - 1), unicodeStream);
2405     }
2406 
2407     /**
2408      * Sets the designated parameter to the given <code>java.io.Reader</code>
2409      * object, which will have the specified number of characters. The
2410      * contents of the reader will be read and sent to the database.
2411      * This method throws an <code>SQLException</code> if the number of bytes
2412      * read and sent to the database is not equal to <i>length</i>.