KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > vti > UpdatableVTITemplate


1 /*
2
3    Derby - Class org.apache.derby.vti.UpdatableVTITemplate
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to You under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20  */

21
22 package org.apache.derby.vti;
23
24 import org.apache.derby.iapi.reference.JDBC20Translation;
25
26 import java.sql.Connection JavaDoc;
27 import java.sql.Date JavaDoc;
28 import java.sql.Statement JavaDoc;
29 import java.sql.PreparedStatement JavaDoc;
30 import java.sql.ResultSet JavaDoc;
31 import java.sql.ResultSetMetaData JavaDoc;
32 import java.sql.Statement JavaDoc;
33 import java.sql.SQLException JavaDoc;
34 import java.sql.SQLWarning JavaDoc;
35 import java.sql.Time JavaDoc;
36 import java.sql.Timestamp JavaDoc;
37 import java.math.BigDecimal JavaDoc;
38 import java.sql.Blob JavaDoc;
39 import java.sql.Ref JavaDoc;
40 import java.sql.Clob JavaDoc;
41 import java.sql.Array JavaDoc;
42
43 import java.io.Reader JavaDoc;
44
45 import java.util.Calendar JavaDoc;
46
47 import java.io.InputStream JavaDoc;
48
49 /**
50
51    An abstract implementation of PreparedStatement (JDK1.1/JDBC 1.2) that is useful
52     when writing a read-write (updatable) virtual table interface (VTI).
53     
54     This class implements
55     the methods of the JDBC1.2 version of PreparedStatement plus the
56     JDBC2.0 getMetaData() method, each one throwing a SQLException
57     with the name of the method. A concrete subclass can then just implement
58     the methods not implemented here and override any methods it needs
59     to implement for correct functionality.
60
61  */

62 public abstract class UpdatableVTITemplate implements PreparedStatement JavaDoc
63 {
64     protected UpdatableVTITemplate() {}
65
66     /**
67      * @see java.sql.Statement
68      *
69      * @exception SQLException on unexpected JDBC error
70      */

71     public ResultSet JavaDoc executeQuery(String JavaDoc sql) throws SQLException JavaDoc
72     {
73         throw new SQLException JavaDoc("executeQuery");
74     }
75
76     /**
77      * @see java.sql.Statement
78      *
79      * @exception SQLException on unexpected JDBC error
80      */

81     public int executeUpdate(String JavaDoc sql) throws SQLException JavaDoc
82     {
83         throw new SQLException JavaDoc("executeUpdate");
84     }
85
86     /**
87      * @see java.sql.Statement
88      *
89      * @exception SQLException on unexpected JDBC error
90      */

91     public void close() throws SQLException JavaDoc
92     {
93         throw new SQLException JavaDoc("close");
94     }
95
96     /**
97      * @see java.sql.Statement
98      *
99      * @exception SQLException on unexpected JDBC error
100      */

101     public SQLWarning JavaDoc getWarnings() throws SQLException JavaDoc
102     {
103         throw new SQLException JavaDoc("getWarnings");
104     }
105
106     /**
107      * @see java.sql.Statement
108      *
109      * @exception SQLException on unexpected JDBC error
110      */

111     public void clearWarnings() throws SQLException JavaDoc
112     {
113         throw new SQLException JavaDoc("clearWarnings");
114     }
115
116     /**
117      * @see java.sql.Statement
118      *
119      * @exception SQLException on unexpected JDBC error
120      */

121     public int getMaxFieldSize() throws SQLException JavaDoc
122     {
123         throw new SQLException JavaDoc("getMaxFieldSize");
124     }
125
126     /**
127      * @see java.sql.Statement
128      *
129      * @exception SQLException on unexpected JDBC error
130      */

131     public void setMaxFieldSize(int max) throws SQLException JavaDoc
132     {
133         throw new SQLException JavaDoc("setMaxFieldSize");
134     }
135
136     /**
137      * @see java.sql.Statement
138      *
139      * @exception SQLException on unexpected JDBC error
140      */

141     public int getMaxRows() throws SQLException JavaDoc
142     {
143         throw new SQLException JavaDoc("getMaxRows");
144     }
145
146     /**
147      * @see java.sql.Statement
148      *
149      * @exception SQLException on unexpected JDBC error
150      */

151     public void setMaxRows(int max) throws SQLException JavaDoc
152     {
153         throw new SQLException JavaDoc("setMaxRows");
154     }
155
156     /**
157      * @see java.sql.Statement
158      *
159      * @exception SQLException on unexpected JDBC error
160      */

161     public void setEscapeProcessing(boolean enable) throws SQLException JavaDoc
162     {
163         throw new SQLException JavaDoc("setEscapeProcessing");
164     }
165
166     /**
167      * @see java.sql.Statement
168      *
169      * @exception SQLException on unexpected JDBC error
170      */

171     public int getQueryTimeout() throws SQLException JavaDoc
172     {
173         throw new SQLException JavaDoc("getQueryTimeout");
174     }
175
176     /**
177      * @see java.sql.Statement
178      *
179      * @exception SQLException on unexpected JDBC error
180      */

181     public void setQueryTimeout(int seconds) throws SQLException JavaDoc
182     {
183         throw new SQLException JavaDoc("setQueryTimeout");
184     }
185
186     /**
187      * @see java.sql.Statement
188      *
189      * @exception SQLException on unexpected JDBC error
190      */

191     public void addBatch(String JavaDoc sql) throws SQLException JavaDoc
192     {
193         throw new SQLException JavaDoc("addBatch");
194     }
195
196     /**
197      * @see java.sql.Statement
198      *
199      * @exception SQLException on unexpected JDBC error
200      */

201     public void clearBatch() throws SQLException JavaDoc
202     {
203         throw new SQLException JavaDoc("clearBatch");
204     }
205
206     /**
207      * @see java.sql.Statement
208      *
209      * @exception SQLException on unexpected JDBC error
210      */

211     public int[] executeBatch() throws SQLException JavaDoc
212     {
213         throw new SQLException JavaDoc("executeBatch");
214     }
215
216     /**
217      * @see java.sql.Statement
218      *
219      * @exception SQLException on unexpected JDBC error
220      */

221     public void cancel() throws SQLException JavaDoc
222     {
223         throw new SQLException JavaDoc("cancel");
224     }
225
226     /**
227      * @see java.sql.Statement
228      *
229      * @exception SQLException on unexpected JDBC error
230      */

231     public void setCursorName(String JavaDoc name) throws SQLException JavaDoc
232     {
233         throw new SQLException JavaDoc("setCursorName");
234     }
235
236     /**
237      * @see java.sql.Statement
238      *
239      * @exception SQLException on unexpected JDBC error
240      */

241     public boolean execute(String JavaDoc sql) throws SQLException JavaDoc
242     {
243         throw new SQLException JavaDoc("execute");
244     }
245
246     /**
247      * @see java.sql.Statement
248      *
249      * @exception SQLException on unexpected JDBC error
250      */

251     public ResultSet JavaDoc getResultSet() throws SQLException JavaDoc
252     {
253         throw new SQLException JavaDoc("getResultSet");
254     }
255
256     /**
257      * @see java.sql.Statement
258      *
259      * @exception SQLException on unexpected JDBC error
260      */

261     public int getUpdateCount() throws SQLException JavaDoc
262     {
263         throw new SQLException JavaDoc("getUpdateCount");
264     }
265
266     /**
267      * @see java.sql.Statement
268      *
269      * @exception SQLException on unexpected JDBC error
270      */

271     public boolean getMoreResults() throws SQLException JavaDoc
272     {
273         throw new SQLException JavaDoc("getMoreResults");
274     }
275
276     /**
277      * @see java.sql.Statement
278      *
279      * @exception SQLException on unexpected JDBC error
280      */

281     public int getResultSetConcurrency() throws SQLException JavaDoc
282     {
283         return JDBC20Translation.CONCUR_UPDATABLE;
284     }
285
286     //
287
// java.sql.PreparedStatement calls, passed through to our preparedStatement.
288
//
289

290     /**
291      * @see java.sql.PreparedStatement
292      *
293      * @exception SQLException on unexpected JDBC error
294      */

295     public ResultSet JavaDoc executeQuery() throws SQLException JavaDoc
296     {
297         throw new SQLException JavaDoc("executeQuery");
298     }
299
300     /**
301      * @see java.sql.PreparedStatement
302      *
303      * @exception SQLException on unexpected JDBC error
304      */

305     public int executeUpdate() throws SQLException JavaDoc
306     {
307         throw new SQLException JavaDoc("executeUpdate");
308     }
309
310     /**
311      * @see java.sql.PreparedStatement
312      *
313      * @exception SQLException on unexpected JDBC error
314      */

315     public void setNull(int parameterIndex, int jdbcType) throws SQLException JavaDoc
316     {
317         throw new SQLException JavaDoc("setNull");
318     }
319
320     /**
321      * @see java.sql.PreparedStatement
322      *
323      * @exception SQLException on unexpected JDBC error
324      */

325     public void setNull(int parameterIndex, int jdbcType, String JavaDoc typeName) throws SQLException JavaDoc
326     {
327         throw new SQLException JavaDoc("setNull");
328     }
329
330     /**
331      * @see java.sql.PreparedStatement
332      *
333      * @exception SQLException on unexpected JDBC error
334      */

335     public void setBoolean(int parameterIndex, boolean x) throws SQLException JavaDoc
336     {
337         throw new SQLException JavaDoc("setBoolean");
338     }
339
340     /**
341      * @see java.sql.PreparedStatement
342      *
343      * @exception SQLException on unexpected JDBC error
344      */

345     public void setByte(int parameterIndex, byte x) throws SQLException JavaDoc
346     {
347         throw new SQLException JavaDoc("setByte");
348     }
349
350     /**
351      * @see java.sql.PreparedStatement
352      *
353      * @exception SQLException on unexpected JDBC error
354      */

355     public void setShort(int parameterIndex, short x) throws SQLException JavaDoc
356     {
357         throw new SQLException JavaDoc("setShort");
358     }
359
360     /**
361      * @see java.sql.PreparedStatement
362      *
363      * @exception SQLException on unexpected JDBC error
364      */

365     public void setInt(int parameterIndex, int x) throws SQLException JavaDoc
366     {
367         throw new SQLException JavaDoc("setInt");
368     }
369
370     /**
371      * @see java.sql.PreparedStatement
372      *
373      * @exception SQLException on unexpected JDBC error
374      */

375     public void setLong(int parameterIndex, long x) throws SQLException JavaDoc
376     {
377         throw new SQLException JavaDoc("setLong");
378     }
379
380     /**
381      * @see java.sql.PreparedStatement
382      *
383      * @exception SQLException on unexpected JDBC error
384      */

385     public void setFloat(int parameterIndex, float x) throws SQLException JavaDoc
386     {
387         throw new SQLException JavaDoc("setFloat");
388     }
389
390     /**
391      * @see java.sql.PreparedStatement
392      *
393      * @exception SQLException on unexpected JDBC error
394      */

395     public void setDouble(int parameterIndex, double x) throws SQLException JavaDoc
396     {
397         throw new SQLException JavaDoc("setDouble");
398     }
399
400     /**
401      * @see java.sql.PreparedStatement
402      *
403      * @exception SQLException on unexpected JDBC error
404      */

405     public void setBigDecimal(int parameterIndex, BigDecimal JavaDoc x) throws SQLException JavaDoc
406     {
407         throw new SQLException JavaDoc("setBigDecimal");
408     }
409
410     /**
411      * @see java.sql.PreparedStatement
412      *
413      * @exception SQLException on unexpected JDBC error
414      */

415     public void setString(int parameterIndex, String JavaDoc x) throws SQLException JavaDoc
416     {
417         throw new SQLException JavaDoc("setString");
418     }
419
420     /**
421      * @see java.sql.PreparedStatement
422      *
423      * @exception SQLException on unexpected JDBC error
424      */

425     public void setBytes(int parameterIndex, byte x[]) throws SQLException JavaDoc
426     {
427         throw new SQLException JavaDoc("setBytes");
428     }
429
430     /**
431      * @see java.sql.PreparedStatement
432      *
433      * @exception SQLException on unexpected JDBC error
434      */

435     public void setDate(int parameterIndex, Date JavaDoc x) throws SQLException JavaDoc
436     {
437         throw new SQLException JavaDoc("setDate");
438     }
439
440     /**
441      * @see java.sql.PreparedStatement
442      *
443      * @exception SQLException on unexpected JDBC error
444      */

445     public void setTime(int parameterIndex, Time JavaDoc x) throws SQLException JavaDoc
446     {
447         throw new SQLException JavaDoc("setTime");
448     }
449
450     /**
451      * @see java.sql.PreparedStatement
452      *
453      * @exception SQLException on unexpected JDBC error
454      */

455     public void setTimestamp(int parameterIndex, Timestamp JavaDoc x) throws SQLException JavaDoc
456     {
457         throw new SQLException JavaDoc("setTimestamp");
458     }
459
460     /**
461      * @see java.sql.PreparedStatement
462      *
463      * @exception SQLException on unexpected JDBC error
464      */

465     public void setAsciiStream(int parameterIndex, InputStream JavaDoc x, int length) throws SQLException JavaDoc
466     {
467         throw new SQLException JavaDoc("setAsciiStream");
468     }
469
470     /**
471      * @see java.sql.PreparedStatement
472      *
473      * @exception SQLException on unexpected JDBC error
474      */

475     public void setUnicodeStream(int parameterIndex, InputStream JavaDoc x, int length) throws SQLException JavaDoc
476     {
477         throw new SQLException JavaDoc("setUnicodeStream");
478     }
479
480     /**
481      * @see java.sql.PreparedStatement
482      *
483      * @exception SQLException on unexpected JDBC error
484      */

485     public void setBinaryStream(int parameterIndex, InputStream JavaDoc x, int length) throws SQLException JavaDoc
486     {
487         throw new SQLException JavaDoc("setBinaryStream");
488     }
489
490     /**
491      * @see java.sql.PreparedStatement
492      *
493      * @exception SQLException on unexpected JDBC error
494      */

495     public void clearParameters() throws SQLException JavaDoc
496     {
497         throw new SQLException JavaDoc("clearParameters");
498     }
499
500     /**
501      * @see java.sql.PreparedStatement
502      *
503      * @exception SQLException on unexpected JDBC error
504      */

505     public void setObject(int parameterIndex, Object JavaDoc x, int targetJdbcType, int scale) throws SQLException JavaDoc
506     {
507         throw new SQLException JavaDoc("setObject");
508     }
509
510     /**
511      * @see java.sql.PreparedStatement
512      *
513      * @exception SQLException on unexpected JDBC error
514      */

515     public void setObject(int parameterIndex, Object JavaDoc x, int targetJdbcType) throws SQLException JavaDoc
516     {
517         throw new SQLException JavaDoc("setObject");
518     }
519
520     /**
521      * @see java.sql.PreparedStatement
522      *
523      * @exception SQLException on unexpected JDBC error
524      */

525     public void setObject(int parameterIndex, Object JavaDoc x) throws SQLException JavaDoc
526     {
527         throw new SQLException JavaDoc("setObject");
528     }
529
530     /**
531      * @see java.sql.PreparedStatement
532      *
533      * @exception SQLException on unexpected JDBC error
534      */

535     public boolean execute() throws SQLException JavaDoc
536     {
537         throw new SQLException JavaDoc("execute");
538     }
539
540     /**
541      * @see java.sql.PreparedStatement
542      *
543      * @exception SQLException on unexpected JDBC error
544      */

545     public ResultSetMetaData JavaDoc getMetaData() throws SQLException JavaDoc
546     {
547         throw new SQLException JavaDoc("ResultSetMetaData");
548     }
549     /**
550      * @see java.sql.PreparedStatement
551      *
552      * @exception SQLException Always thrown
553      */

554     public int getResultSetType() throws SQLException JavaDoc {
555         throw new SQLException JavaDoc("getResultSetType");
556     }
557
558     /**
559      * @see java.sql.PreparedStatement
560      *
561      * @exception SQLException Always thrown
562      */

563     public void setBlob(int i, Blob JavaDoc x) throws SQLException JavaDoc {
564         throw new SQLException JavaDoc("setBlob");
565     }
566
567     /**
568      * @see java.sql.PreparedStatement
569      *
570      * @exception SQLException Always thrown
571      */

572     public void setFetchDirection(int direction) throws SQLException JavaDoc {
573         throw new SQLException JavaDoc("setFetchDirection");
574     }
575
576     /**
577      * @see java.sql.PreparedStatement
578      *
579      * @exception SQLException Always thrown
580      */

581     public void setFetchSize(int rows) throws SQLException JavaDoc {
582         throw new SQLException JavaDoc("setFetchSize");
583     }
584
585     /**
586      * @see java.sql.PreparedStatement
587      *
588      * @exception SQLException Always thrown
589      */

590     public void addBatch() throws SQLException JavaDoc {
591         throw new SQLException JavaDoc("addBatch");
592     }
593
594
595     /**
596      * @see java.sql.PreparedStatement
597      *
598      * @exception SQLException Always thrown
599      */

600     public void setCharacterStream(int parameterIndex,
601                                     Reader JavaDoc reader,
602                                     int length) throws SQLException JavaDoc {
603         throw new SQLException JavaDoc("setCharacterStream");
604     }
605
606     /**
607      * @see java.sql.PreparedStatement
608      *
609      * @exception SQLException Always thrown
610      */

611     public Connection JavaDoc getConnection() throws SQLException JavaDoc {
612         throw new SQLException JavaDoc("getConnection");
613     }
614
615     /**
616      * @see java.sql.PreparedStatement
617      *
618      * @exception SQLException Always thrown
619      */

620     public int getFetchDirection() throws SQLException JavaDoc {
621         throw new SQLException JavaDoc("getFetchDirection");
622     }
623
624     /**
625      * @see java.sql.PreparedStatement
626      *
627      * @exception SQLException Always thrown
628      */

629     public void setTime(int parameterIndex, Time JavaDoc x, Calendar JavaDoc cal)
630                                 throws SQLException JavaDoc {
631         throw new SQLException JavaDoc("setTime");
632     }
633
634     /**
635      * @see java.sql.PreparedStatement
636      *
637      * @exception SQLException Always thrown
638      */

639     public void setTimestamp(int parameterIndex, Timestamp JavaDoc x, Calendar JavaDoc cal)
640                                 throws SQLException JavaDoc {
641         throw new SQLException JavaDoc("setTimestamp");
642     }
643
644     /**
645      * @see java.sql.PreparedStatement
646      *
647      * @exception SQLException Always thrown
648      */

649     public int getFetchSize() throws SQLException JavaDoc {
650         throw new SQLException JavaDoc("getFetchSize");
651     }
652
653     /**
654      * @see java.sql.PreparedStatement
655      *
656      * @exception SQLException Always thrown
657      */

658     public void setRef(int i, Ref JavaDoc x) throws SQLException JavaDoc {
659         throw new SQLException JavaDoc("setRef");
660     }
661
662     /**
663      * @see java.sql.PreparedStatement
664      *
665      * @exception SQLException Always thrown
666      */

667     public void setDate(int parameterIndex, Date JavaDoc x, Calendar JavaDoc cal)
668                         throws SQLException JavaDoc {
669         throw new SQLException JavaDoc("setDate");
670     }
671
672     /**
673      * @see java.sql.PreparedStatement
674      *
675      * @exception SQLException Always thrown
676      */

677     public void setClob(int i, Clob JavaDoc x) throws SQLException JavaDoc {
678         throw new SQLException JavaDoc("setClob");
679     }
680
681     /**
682      * @see java.sql.PreparedStatement
683      *
684      * @exception SQLException Always thrown
685      */

686     public void setArray(int i, Array JavaDoc x) throws SQLException JavaDoc {
687         throw new SQLException JavaDoc("setArray");
688     }
689 }
690
Popular Tags