First version committed to git
[zpugcc/jano.git] / toolchain / gcc / libjava / java / sql / Clob.java
blobf764f5cfcc29e6b25047083b00f4208dbf401c8f
1 /* Clob.java -- Access Character Large OBjects
2 Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 02111-1307 USA.
21 Linking this library statically or dynamically with other modules is
22 making a combined work based on this library. Thus, the terms and
23 conditions of the GNU General Public License cover the whole
24 combination.
26 As a special exception, the copyright holders of this library give you
27 permission to link this library with independent modules to produce an
28 executable, regardless of the license terms of these independent
29 modules, and to copy and distribute the resulting executable under
30 terms of your choice, provided that you also meet, for each linked
31 independent module, the terms and conditions of the license of that
32 module. An independent module is a module which is not derived from
33 or based on this library. If you modify this library, you may extend
34 this exception to your version of the library, but you are not
35 obligated to do so. If you do not wish to do so, delete this
36 exception statement from your version. */
38 package java.sql;
40 import java.io.InputStream;
41 import java.io.OutputStream;
42 import java.io.Reader;
43 import java.io.Writer;
45 /**
46 * This interface contains methods for accessing a SQL CLOB (Character
47 * Large OBject) type.
49 * @author Aaron M. Renn (arenn@urbanophile.com)
51 public interface Clob
53 /**
54 * This method returns the number of characters in the CLOB.
56 * @return The number of characters in the CLOB.
57 * @exception SQLException If an error occurs.
58 * @since 1.2
60 long length() throws SQLException;
62 /**
63 * This method returns the specified portion of the CLOB as a
64 * <code>String</code>.
66 * @param offset The index into the CLOB (index values start at 1) to
67 * start returning characters from.
68 * @param length The requested number of characters to return.
69 * @return The requested CLOB section, as a <code>String</code>.
70 * @exception SQLException If an error occurs.
71 * @since 1.2
73 String getSubString(long pos, int length) throws SQLException;
75 /**
76 * This method returns a character stream that reads the contents of the
77 * CLOB.
79 * @return A character stream to read the CLOB's contents.
80 * @exception SQLException If an error occurs.
81 * @since 1.2
83 Reader getCharacterStream() throws SQLException;
85 /**
86 * This method returns a byte stream that reads the contents of the
87 * CLOB as a series of ASCII bytes.
89 * @return A stream to read the CLOB's contents.
90 * @exception SQLException If an error occurs.
91 * @since 1.2
93 InputStream getAsciiStream() throws SQLException;
95 /**
96 * This method returns the index into the CLOB of the first occurrence of
97 * the specified character pattern (supplied by the caller as a
98 * <code>String</code>). The search begins at the specified index.
100 * @param searchstr The character pattern to search for, passed as a
101 * <code>String</code>.
102 * @param start. The index into the CLOB to start search (indexes start
103 * at 1).
104 * @return The index at which the pattern was found (indexes start at 1),
105 * or -1 if the pattern was not found.
106 * @exception SQLException If an error occurs.
107 * @since 1.2
109 long position(String searchstr, long start) throws SQLException;
112 * This method returns the index into the CLOB of the first occurrence of
113 * the specified character pattern (supplied by the caller as a
114 * <code>Clob</code>). The search begins at the specified index.
116 * @param searchstr The character pattern to search for, passed as a
117 * <code>Clob</code>.
118 * @param start. The index into the CLOB to start search (indexes start
119 * at 1).
120 * @return The index at which the pattern was found (indexes start at 1),
121 * or -1 if the pattern was not found.
122 * @exception SQLException If an error occurs.
123 * @since 1.2
125 long position(Clob searchstr, long start) throws SQLException;
128 * @since 1.4
130 int setString(long pos, String str) throws SQLException;
133 * @since 1.4
135 int setString(long pos, String str, int offset, int len)
136 throws SQLException;
139 * @since 1.4
141 OutputStream setAsciiStream(long pos) throws SQLException;
144 * @since 1.4
146 Writer setCharacterStream(long pos) throws SQLException;
149 * @since 1.4
151 void truncate(long len) throws SQLException;