1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45 package org.melati.poem.dbms.test.sql;
46
47 import java.io.InputStream;
48 import java.io.OutputStream;
49 import java.io.Reader;
50 import java.io.Writer;
51 import java.sql.Clob;
52 import java.sql.NClob;
53 import java.sql.SQLException;
54
55
56
57
58
59
60 public class ThrowingNClob extends Thrower implements NClob {
61
62 NClob it = null;
63
64
65
66
67 public ThrowingNClob(NClob nc) {
68 it = nc;
69 }
70
71
72
73
74
75
76 public void free() throws SQLException {
77 if (shouldThrow(this.getClass().getInterfaces()[0], "free"))
78 throw new SQLException("NClob bombed");
79 it.free();
80 }
81
82
83
84
85
86
87 public InputStream getAsciiStream() throws SQLException {
88 if (shouldThrow(this.getClass().getInterfaces()[0], "getAsciiStream"))
89 throw new SQLException("NClob bombed");
90 return it.getAsciiStream();
91 }
92
93
94
95
96
97
98 public Reader getCharacterStream() throws SQLException {
99 if (shouldThrow(this.getClass().getInterfaces()[0], "getCharacterStream"))
100 throw new SQLException("NClob bombed");
101 return it.getCharacterStream();
102 }
103
104
105
106
107
108
109 public Reader getCharacterStream(long pos, long length) throws SQLException {
110 if (shouldThrow(this.getClass().getInterfaces()[0], "getCharacterStream"))
111 throw new SQLException("NClob bombed");
112 return it.getCharacterStream(pos, length);
113 }
114
115
116
117
118
119
120 public String getSubString(long pos, int length) throws SQLException {
121 if (shouldThrow(this.getClass().getInterfaces()[0], "getSubString"))
122 throw new SQLException("NClob bombed");
123 return it.getSubString(pos, length);
124 }
125
126
127
128
129
130
131 public long length() throws SQLException {
132 if (shouldThrow(this.getClass().getInterfaces()[0], "length"))
133 throw new SQLException("NClob bombed");
134 return it.length();
135 }
136
137
138
139
140
141
142 public long position(String searchstr, long start) throws SQLException {
143 if (shouldThrow(this.getClass().getInterfaces()[0], "position"))
144 throw new SQLException("NClob bombed");
145 return it.position(searchstr, start);
146 }
147
148
149
150
151
152
153 public long position(Clob searchstr, long start) throws SQLException {
154 if (shouldThrow(this.getClass().getInterfaces()[0], "position"))
155 throw new SQLException("NClob bombed");
156 return it.position(searchstr, start);
157 }
158
159
160
161
162
163
164 public OutputStream setAsciiStream(long pos) throws SQLException {
165 if (shouldThrow(this.getClass().getInterfaces()[0], "setAsciiStream"))
166 throw new SQLException("NClob bombed");
167 return it.setAsciiStream(pos);
168 }
169
170
171
172
173
174
175 public Writer setCharacterStream(long pos) throws SQLException {
176 if (shouldThrow(this.getClass().getInterfaces()[0], "setCharacterStream"))
177 throw new SQLException("NClob bombed");
178 return it.setCharacterStream(pos);
179 }
180
181
182
183
184
185
186 public int setString(long pos, String str) throws SQLException {
187 if (shouldThrow(this.getClass().getInterfaces()[0], "setString"))
188 throw new SQLException("NClob bombed");
189 return it.setString(pos, str);
190 }
191
192
193
194
195
196
197 public int setString(long pos, String str, int offset, int len)
198 throws SQLException {
199 if (shouldThrow(this.getClass().getInterfaces()[0], "setString"))
200 throw new SQLException("NClob bombed");
201 return it.setString(pos, str, offset, len);
202 }
203
204
205
206
207
208
209 public void truncate(long len) throws SQLException {
210 if (shouldThrow(this.getClass().getInterfaces()[0], "truncate"))
211 throw new SQLException("NClob bombed");
212 it.truncate(len);
213 }
214
215 }