source: trunk/gcc/libjava/java/sql/Clob.java

Last change on this file was 1392, checked in by bird, 21 years ago

This commit was generated by cvs2svn to compensate for changes in r1391,
which included commits to RCS files with non-trunk default branches.

  • Property cvs2svn:cvs-rev set to 1.1.1.2
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 5.1 KB
Line 
1/* Clob.java -- Access Character Large OBjects
2 Copyright (C) 1999, 2000, 2002 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
38package java.sql;
39
40import java.io.InputStream;
41import java.io.OutputStream;
42import java.io.Reader;
43import java.io.Writer;
44
45/**
46 * This interface contains methods for accessing a SQL CLOB (Character
47 * Large OBject) type.
48 *
49 * @author Aaron M. Renn (arenn@urbanophile.com)
50 */
51public interface Clob
52{
53 /**
54 * This method returns the number of characters in the CLOB.
55 *
56 * @return The number of characters in the CLOB.
57 * @exception SQLException If an error occurs.
58 * @since 1.2
59 */
60 public long length() throws SQLException;
61
62 /**
63 * This method returns the specified portion of the CLOB as a
64 * <code>String</code>.
65 *
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
72 */
73 public String getSubString(long pos, int length) throws SQLException;
74
75 /**
76 * This method returns a character stream that reads the contents of the
77 * CLOB.
78 *
79 * @return A character stream to read the CLOB's contents.
80 * @exception SQLException If an error occurs.
81 * @since 1.2
82 */
83 public Reader getCharacterStream() throws SQLException;
84
85 /**
86 * This method returns a byte stream that reads the contents of the
87 * CLOB as a series of ASCII bytes.
88 *
89 * @return A stream to read the CLOB's contents.
90 * @exception SQLException If an error occurs.
91 * @since 1.2
92 */
93 public InputStream getAsciiStream() throws SQLException;
94
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.
99 *
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
108 */
109 public long position(String searchstr, long start) throws SQLException;
110
111 /**
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.
115 *
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
124 */
125 public long position(Clob searchstr, long start) throws SQLException;
126
127 /**
128 * @since 1.4
129 */
130 public int setString(long pos, String str) throws SQLException;
131
132 /**
133 * @since 1.4
134 */
135 public int setString(long pos, String str, int offset, int len)
136 throws SQLException;
137
138 /**
139 * @since 1.4
140 */
141 public OutputStream setAsciiStream(long pos) throws SQLException;
142
143 /**
144 * @since 1.4
145 */
146 public Writer setCharacterStream(long pos) throws SQLException;
147
148 /**
149 * @since 1.4
150 */
151 public void truncate(long len) throws SQLException;
152}
Note: See TracBrowser for help on using the repository browser.