source: trunk/src/gcc/libjava/java/sql/Clob.java@ 1213

Last change on this file since 1213 was 2, checked in by bird, 23 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 4.9 KB
Line 
1/* Clob.java -- Access Character Large OBjects
2 Copyright (C) 1999, 2000 Free Software Foundation, Inc.
3
4This file is part of GNU Classpath.
5
6GNU Classpath is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2, or (at your option)
9any later version.
10
11GNU Classpath is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GNU Classpath; see the file COPYING. If not, write to the
18Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1902111-1307 USA.
20
21Linking this library statically or dynamically with other modules is
22making a combined work based on this library. Thus, the terms and
23conditions of the GNU General Public License cover the whole
24combination.
25
26As a special exception, the copyright holders of this library give you
27permission to link this library with independent modules to produce an
28executable, regardless of the license terms of these independent
29modules, and to copy and distribute the resulting executable under
30terms of your choice, provided that you also meet, for each linked
31independent module, the terms and conditions of the license of that
32module. An independent module is a module which is not derived from
33or based on this library. If you modify this library, you may extend
34this exception to your version of the library, but you are not
35obligated to do so. If you do not wish to do so, delete this
36exception statement from your version. */
37
38
39package java.sql;
40
41import java.io.InputStream;
42import java.io.Reader;
43
44/**
45 * This interface contains methods for accessing a SQL CLOB (Character
46 * Large OBject) type.
47 *
48 * @author Aaron M. Renn ([email protected])
49 */
50public interface Clob
51{
52
53/**
54 * This method returns the number of characters in the CLOB.
55 *
56 * @return The number of characters in the CLOB.
57 *
58 * @exception SQLException If an error occurs.
59 */
60public abstract long
61length() throws SQLException;
62
63/*************************************************************************/
64
65/**
66 * This method returns the specified portion of the CLOB as a
67 * <code>String</code>.
68 *
69 * @param offset The index into the CLOB (index values start at 1) to
70 * start returning characters from.
71 * @param length The requested number of characters to return.
72 *
73 * @return The requested CLOB section, as a <code>String</code>.
74 *
75 * @exception SQLException If an error occurs.
76 */
77public abstract String
78getSubString(long offset, int length) throws SQLException;
79
80/*************************************************************************/
81
82/**
83 * This method returns a byte stream that reads the contents of the
84 * CLOB as a series of ASCII bytes.
85 *
86 * @return A stream to read the CLOB's contents.
87 *
88 * @exception SQLException If an error occurs.
89 */
90public abstract InputStream
91getAsciiStream() throws SQLException;
92
93/*************************************************************************/
94
95/**
96 * This method returns a character stream that reads the contents of the
97 * CLOB.
98 *
99 * @return A character stream to read the CLOB's contents.
100 *
101 * @exception SQLException If an error occurs.
102 */
103public abstract Reader
104getCharacterStream() throws SQLException;
105
106/*************************************************************************/
107
108/**
109 * This method returns the index into the CLOB of the first occurrence of
110 * the specified character pattern (supplied by the caller as a
111 * <code>String</code>). The search begins at the specified index.
112 *
113 * @param pattern The character pattern to search for, passed as a
114 * <code>String</code>.
115 * @param offset. The index into the CLOB to start search (indexes start
116 * at 1).
117 *
118 * @return The index at which the pattern was found (indexes start at 1),
119 * or -1 if the pattern was not found.
120 *
121 * @exception SQLException If an error occurs.
122 */
123public abstract long
124position(String pattern, long offset) throws SQLException;
125
126/*************************************************************************/
127
128/**
129 * This method returns the index into the CLOB of the first occurrence of
130 * the specified character pattern (supplied by the caller as a
131 * <code>Clob</code>). The search begins at the specified index.
132 *
133 * @param pattern The character pattern to search for, passed as a
134 * <code>Clob</code>.
135 * @param offset. The index into the CLOB to start search (indexes start
136 * at 1).
137 *
138 * @return The index at which the pattern was found (indexes start at 1),
139 * or -1 if the pattern was not found.
140 *
141 * @exception SQLException If an error occurs.
142 */
143public abstract long
144position(Clob pattern, long offset) throws SQLException;
145
146} // interface Clob
147
Note: See TracBrowser for help on using the repository browser.