jdk/src/share/classes/java/sql/Clob.java
author lancea
Thu, 27 Jun 2013 15:07:56 -0400
changeset 18564 f9db68ff2cbb
parent 5506 202f599c92aa
child 21278 ef8a3a2a72f2
permissions -rw-r--r--
8017471: Fix JDBC -Xdoclint public errors Reviewed-by: darcy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
18564
f9db68ff2cbb 8017471: Fix JDBC -Xdoclint public errors
lancea
parents: 5506
diff changeset
     2
 * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package java.sql;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.io.Reader;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
/**
18564
f9db68ff2cbb 8017471: Fix JDBC -Xdoclint public errors
lancea
parents: 5506
diff changeset
    31
 * The mapping in the Java™ programming language
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * for the SQL <code>CLOB</code> type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * An SQL <code>CLOB</code> is a built-in type
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * that stores a Character Large Object as a column value in a row of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * a database table.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * By default drivers implement a <code>Clob</code> object using an SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * <code>locator(CLOB)</code>, which means that a <code>Clob</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * contains a logical pointer to the SQL <code>CLOB</code> data rather than
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * the data itself. A <code>Clob</code> object is valid for the duration
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * of the transaction in which it was created.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * <P>The <code>Clob</code> interface provides methods for getting the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * length of an SQL <code>CLOB</code> (Character Large Object) value,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * for materializing a <code>CLOB</code> value on the client, and for
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * searching for a substring or <code>CLOB</code> object within a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * <code>CLOB</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * Methods in the interfaces {@link ResultSet},
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * {@link CallableStatement}, and {@link PreparedStatement}, such as
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * <code>getClob</code> and <code>setClob</code> allow a programmer to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * access an SQL <code>CLOB</code> value.  In addition, this interface
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * has methods for updating a <code>CLOB</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * All methods on the <code>Clob</code> interface must be fully implemented if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 * JDBC driver supports the data type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
public interface Clob {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
  /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
   * Retrieves the number of characters
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
   * in the <code>CLOB</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
   * designated by this <code>Clob</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
   *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
   * @return length of the <code>CLOB</code> in characters
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
   * @exception SQLException if there is an error accessing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
   *            length of the <code>CLOB</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
   * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
   * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
   * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
   */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
  long length() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
  /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
   * Retrieves a copy of the specified substring
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
   * in the <code>CLOB</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
   * designated by this <code>Clob</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
   * The substring begins at position
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
   * <code>pos</code> and has up to <code>length</code> consecutive
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
   * characters.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
   *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
   * @param pos the first character of the substring to be extracted.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
   *            The first character is at position 1.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
   * @param length the number of consecutive characters to be copied;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
   * the value for length must be 0 or greater
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
   * @return a <code>String</code> that is the specified substring in
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
   *         the <code>CLOB</code> value designated by this <code>Clob</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
   * @exception SQLException if there is an error accessing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
   *            <code>CLOB</code> value; if pos is less than 1 or length is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
   * less than 0
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
   * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
   * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
   * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
   */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
  String getSubString(long pos, int length) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
  /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
   * Retrieves the <code>CLOB</code> value designated by this <code>Clob</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
   * object as a <code>java.io.Reader</code> object (or as a stream of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
   * characters).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
   *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
   * @return a <code>java.io.Reader</code> object containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
   *         <code>CLOB</code> data
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
   * @exception SQLException if there is an error accessing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
   *            <code>CLOB</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
   * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
   * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
   * @see #setCharacterStream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
   * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
   */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
  java.io.Reader getCharacterStream() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
  /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
   * Retrieves the <code>CLOB</code> value designated by this <code>Clob</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
   * object as an ascii stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
   *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
   * @return a <code>java.io.InputStream</code> object containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
   *         <code>CLOB</code> data
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
   * @exception SQLException if there is an error accessing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
   *            <code>CLOB</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
   * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
   * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
   * @see #setAsciiStream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
   * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
   */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
  java.io.InputStream getAsciiStream() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
  /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
   * Retrieves the character position at which the specified substring
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
   * <code>searchstr</code> appears in the SQL <code>CLOB</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
   * represented by this <code>Clob</code> object.  The search
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
   * begins at position <code>start</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
   *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
   * @param searchstr the substring for which to search
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
   * @param start the position at which to begin searching; the first position
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
   *              is 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
   * @return the position at which the substring appears or -1 if it is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
   *         present; the first position is 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
   * @exception SQLException if there is an error accessing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
   *            <code>CLOB</code> value or if pos is less than 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
   * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
   * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
   * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
   */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
  long position(String searchstr, long start) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
  /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
   * Retrieves the character position at which the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
   * <code>Clob</code> object <code>searchstr</code> appears in this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
   * <code>Clob</code> object.  The search begins at position
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
   * <code>start</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
   *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
   * @param searchstr the <code>Clob</code> object for which to search
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
   * @param start the position at which to begin searching; the first
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
   *              position is 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
   * @return the position at which the <code>Clob</code> object appears
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
   *              or -1 if it is not present; the first position is 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
   * @exception SQLException if there is an error accessing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
   *            <code>CLOB</code> value or if start is less than 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
   * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
   * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
   * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
   */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
  long position(Clob searchstr, long start) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
    //---------------------------- jdbc 3.0 -----------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     * Writes the given Java <code>String</code> to the <code>CLOB</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     * value that this <code>Clob</code> object designates at the position
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
     * <code>pos</code>. The string will overwrite the existing characters
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
     * in the <code>Clob</code> object starting at the position
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
     * <code>pos</code>.  If the end of the <code>Clob</code> value is reached
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
     * while writing the given string, then the length of the <code>Clob</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     * value will be increased to accomodate the extra characters.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
     * <b>Note:</b> If the value specified for <code>pos</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
     * is greater then the length+1 of the <code>CLOB</code> value then the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     * behavior is undefined. Some JDBC drivers may throw a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
     * <code>SQLException</code> while other drivers may support this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
     * operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
     * @param pos the position at which to start writing to the <code>CLOB</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
     *         value that this <code>Clob</code> object represents;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
     * The first position is 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
     * @param str the string to be written to the <code>CLOB</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
     *        value that this <code>Clob</code> designates
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     * @return the number of characters written
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
     * @exception SQLException if there is an error accessing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     *            <code>CLOB</code> value or if pos is less than 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
    int setString(long pos, String str) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     * Writes <code>len</code> characters of <code>str</code>, starting
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
     * at character <code>offset</code>, to the <code>CLOB</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
     * that this <code>Clob</code> represents.  The string will overwrite the existing characters
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
     * in the <code>Clob</code> object starting at the position
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
     * <code>pos</code>.  If the end of the <code>Clob</code> value is reached
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
     * while writing the given string, then the length of the <code>Clob</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
     * value will be increased to accomodate the extra characters.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
     * <b>Note:</b> If the value specified for <code>pos</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     * is greater then the length+1 of the <code>CLOB</code> value then the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     * behavior is undefined. Some JDBC drivers may throw a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
     * <code>SQLException</code> while other drivers may support this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
     * operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
     * @param pos the position at which to start writing to this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
     *        <code>CLOB</code> object; The first position  is 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     * @param str the string to be written to the <code>CLOB</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
     *        value that this <code>Clob</code> object represents
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
     * @param offset the offset into <code>str</code> to start reading
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
     *        the characters to be written
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
     * @param len the number of characters to be written
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
     * @return the number of characters written
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
     * @exception SQLException if there is an error accessing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
     *            <code>CLOB</code> value or if pos is less than 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    int setString(long pos, String str, int offset, int len) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
     * Retrieves a stream to be used to write Ascii characters to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
     * <code>CLOB</code> value that this <code>Clob</code> object represents,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
     * starting at position <code>pos</code>.  Characters written to the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
     * will overwrite the existing characters
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
     * in the <code>Clob</code> object starting at the position
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
     * <code>pos</code>.  If the end of the <code>Clob</code> value is reached
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
     * while writing characters to the stream, then the length of the <code>Clob</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
     * value will be increased to accomodate the extra characters.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
     * <b>Note:</b> If the value specified for <code>pos</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
     * is greater then the length+1 of the <code>CLOB</code> value then the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
     * behavior is undefined. Some JDBC drivers may throw a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
     * <code>SQLException</code> while other drivers may support this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
     * operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
     * @param pos the position at which to start writing to this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
     *        <code>CLOB</code> object; The first position is 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
     * @return the stream to which ASCII encoded characters can be written
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
     * @exception SQLException if there is an error accessing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
     *            <code>CLOB</code> value or if pos is less than 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
     * @see #getAsciiStream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
    java.io.OutputStream setAsciiStream(long pos) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
     * Retrieves a stream to be used to write a stream of Unicode characters
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
     * to the <code>CLOB</code> value that this <code>Clob</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
     * represents, at position <code>pos</code>. Characters written to the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
     * will overwrite the existing characters
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
     * in the <code>Clob</code> object starting at the position
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
     * <code>pos</code>.  If the end of the <code>Clob</code> value is reached
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
     * while writing characters to the stream, then the length of the <code>Clob</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
     * value will be increased to accomodate the extra characters.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
     * <b>Note:</b> If the value specified for <code>pos</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
     * is greater then the length+1 of the <code>CLOB</code> value then the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
     * behavior is undefined. Some JDBC drivers may throw a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
     * <code>SQLException</code> while other drivers may support this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
     * operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
     * @param  pos the position at which to start writing to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
     *        <code>CLOB</code> value; The first position is 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
     * @return a stream to which Unicode encoded characters can be written
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
     * @exception SQLException if there is an error accessing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
     *            <code>CLOB</code> value or if pos is less than 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
     * @see #getCharacterStream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
    java.io.Writer setCharacterStream(long pos) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
     * Truncates the <code>CLOB</code> value that this <code>Clob</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
     * designates to have a length of <code>len</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
     * characters.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
     * <b>Note:</b> If the value specified for <code>pos</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
     * is greater then the length+1 of the <code>CLOB</code> value then the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
     * behavior is undefined. Some JDBC drivers may throw a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
     * <code>SQLException</code> while other drivers may support this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
     * operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
     * @param len the length, in characters, to which the <code>CLOB</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
     *        should be truncated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
     * @exception SQLException if there is an error accessing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
     *            <code>CLOB</code> value or if len is less than 0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
    void truncate(long len) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
     * This method frees the <code>Clob</code> object and releases the resources the resources
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
     * that it holds.  The object is invalid once the <code>free</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
     * is called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
     * After <code>free</code> has been called, any attempt to invoke a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
     * method other than <code>free</code> will result in a <code>SQLException</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
     * being thrown.  If <code>free</code> is called multiple times, the subsequent
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
     * calls to <code>free</code> are treated as a no-op.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
     * @throws SQLException if an error occurs releasing
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
     * the Clob's resources
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
    void free() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
     * Returns a <code>Reader</code> object that contains a partial <code>Clob</code> value, starting
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
     * with the character specified by pos, which is length characters in length.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
     * @param pos the offset to the first character of the partial value to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
     * be retrieved.  The first character in the Clob is at position 1.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
     * @param length the length in characters of the partial value to be retrieved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
     * @return <code>Reader</code> through which the partial <code>Clob</code> value can be read.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
     * @throws SQLException if pos is less than 1 or if pos is greater than the number of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
     * characters in the <code>Clob</code> or if pos + length is greater than the number of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
     * characters in the <code>Clob</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
    Reader getCharacterStream(long pos, long length) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
}