View Javadoc
1   /*******************************************************************************
2    * Copyright 2012 pw999
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    * http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   ******************************************************************************/
16  package net.sf.oqt.driver;
17  
18  import java.io.InputStream;
19  import java.io.Reader;
20  import java.math.BigDecimal;
21  import java.net.URL;
22  import java.sql.Array;
23  import java.sql.Blob;
24  import java.sql.Clob;
25  import java.sql.Connection;
26  import java.sql.Date;
27  import java.sql.NClob;
28  import java.sql.ParameterMetaData;
29  import java.sql.PreparedStatement;
30  import java.sql.Ref;
31  import java.sql.ResultSet;
32  import java.sql.ResultSetMetaData;
33  import java.sql.RowId;
34  import java.sql.SQLException;
35  import java.sql.SQLWarning;
36  import java.sql.SQLXML;
37  import java.sql.Time;
38  import java.sql.Timestamp;
39  import java.util.Calendar;
40  
41  import net.sf.oqt.core.CoreFactory;
42  
43  class NullPreparedStatement implements PreparedStatement {
44  
45      NullPreparedStatement(final String sql) {
46          CoreFactory.getQueries().add(sql);
47      }
48  
49      @Override
50      public void addBatch(final String sql) throws SQLException {
51          // TODO Auto-generated method stub
52  
53      }
54  
55      @Override
56      public void cancel() throws SQLException {
57          // TODO Auto-generated method stub
58  
59      }
60  
61      @Override
62      public void clearBatch() throws SQLException {
63          // TODO Auto-generated method stub
64  
65      }
66  
67      @Override
68      public void clearWarnings() throws SQLException {
69          // TODO Auto-generated method stub
70  
71      }
72  
73      @Override
74      public void close() throws SQLException {
75          // TODO Auto-generated method stub
76  
77      }
78  
79      @Override
80      public void closeOnCompletion() throws SQLException {
81          // TODO Auto-generated method stub
82  
83      }
84  
85      @Override
86      public boolean execute(final String sql) throws SQLException {
87          // TODO Auto-generated method stub
88          return false;
89      }
90  
91      @Override
92      public boolean execute(final String sql, final int autoGeneratedKeys) throws SQLException {
93          // TODO Auto-generated method stub
94          return false;
95      }
96  
97      @Override
98      public boolean execute(final String sql, final int[] columnIndexes) throws SQLException {
99          // TODO Auto-generated method stub
100         return false;
101     }
102 
103     @Override
104     public boolean execute(final String sql, final String[] columnNames) throws SQLException {
105         // TODO Auto-generated method stub
106         return false;
107     }
108 
109     @Override
110     public int[] executeBatch() throws SQLException {
111         // TODO Auto-generated method stub
112         return null;
113     }
114 
115     @Override
116     public ResultSet executeQuery(final String sql) throws SQLException {
117         return new NullResultSet();
118     }
119 
120     @Override
121     public int executeUpdate(final String sql) throws SQLException {
122         // TODO Auto-generated method stub
123         return 0;
124     }
125 
126     @Override
127     public int executeUpdate(final String sql, final int autoGeneratedKeys) throws SQLException {
128         // TODO Auto-generated method stub
129         return 0;
130     }
131 
132     @Override
133     public int executeUpdate(final String sql, final int[] columnIndexes) throws SQLException {
134         // TODO Auto-generated method stub
135         return 0;
136     }
137 
138     @Override
139     public int executeUpdate(final String sql, final String[] columnNames) throws SQLException {
140         // TODO Auto-generated method stub
141         return 0;
142     }
143 
144     @Override
145     public Connection getConnection() throws SQLException {
146         // TODO Auto-generated method stub
147         return null;
148     }
149 
150     @Override
151     public int getFetchDirection() throws SQLException {
152         // TODO Auto-generated method stub
153         return 0;
154     }
155 
156     @Override
157     public int getFetchSize() throws SQLException {
158         // TODO Auto-generated method stub
159         return 0;
160     }
161 
162     @Override
163     public ResultSet getGeneratedKeys() throws SQLException {
164         // TODO Auto-generated method stub
165         return null;
166     }
167 
168     @Override
169     public int getMaxFieldSize() throws SQLException {
170         // TODO Auto-generated method stub
171         return 0;
172     }
173 
174     @Override
175     public int getMaxRows() throws SQLException {
176         // TODO Auto-generated method stub
177         return 0;
178     }
179 
180     @Override
181     public boolean getMoreResults() throws SQLException {
182         // TODO Auto-generated method stub
183         return false;
184     }
185 
186     @Override
187     public boolean getMoreResults(final int current) throws SQLException {
188         // TODO Auto-generated method stub
189         return false;
190     }
191 
192     @Override
193     public int getQueryTimeout() throws SQLException {
194         // TODO Auto-generated method stub
195         return 0;
196     }
197 
198     @Override
199     public ResultSet getResultSet() throws SQLException {
200         // TODO Auto-generated method stub
201         return null;
202     }
203 
204     @Override
205     public int getResultSetConcurrency() throws SQLException {
206         // TODO Auto-generated method stub
207         return 0;
208     }
209 
210     @Override
211     public int getResultSetHoldability() throws SQLException {
212         // TODO Auto-generated method stub
213         return 0;
214     }
215 
216     @Override
217     public int getResultSetType() throws SQLException {
218         // TODO Auto-generated method stub
219         return 0;
220     }
221 
222     @Override
223     public int getUpdateCount() throws SQLException {
224         // TODO Auto-generated method stub
225         return 0;
226     }
227 
228     @Override
229     public SQLWarning getWarnings() throws SQLException {
230         // TODO Auto-generated method stub
231         return null;
232     }
233 
234     @Override
235     public boolean isCloseOnCompletion() throws SQLException {
236         // TODO Auto-generated method stub
237         return false;
238     }
239 
240     @Override
241     public boolean isClosed() throws SQLException {
242         // TODO Auto-generated method stub
243         return false;
244     }
245 
246     @Override
247     public boolean isPoolable() throws SQLException {
248         // TODO Auto-generated method stub
249         return false;
250     }
251 
252     @Override
253     public void setCursorName(final String name) throws SQLException {
254         // TODO Auto-generated method stub
255 
256     }
257 
258     @Override
259     public void setEscapeProcessing(final boolean enable) throws SQLException {
260         // TODO Auto-generated method stub
261 
262     }
263 
264     @Override
265     public void setFetchDirection(final int direction) throws SQLException {
266         // TODO Auto-generated method stub
267 
268     }
269 
270     @Override
271     public void setFetchSize(final int rows) throws SQLException {
272         // TODO Auto-generated method stub
273 
274     }
275 
276     @Override
277     public void setMaxFieldSize(final int max) throws SQLException {
278         // TODO Auto-generated method stub
279 
280     }
281 
282     @Override
283     public void setMaxRows(final int max) throws SQLException {
284         // TODO Auto-generated method stub
285 
286     }
287 
288     @Override
289     public void setPoolable(final boolean poolable) throws SQLException {
290         // TODO Auto-generated method stub
291 
292     }
293 
294     @Override
295     public void setQueryTimeout(final int seconds) throws SQLException {
296         // TODO Auto-generated method stub
297 
298     }
299 
300     @Override
301     public boolean isWrapperFor(final Class<?> iface) throws SQLException {
302         // TODO Auto-generated method stub
303         return false;
304     }
305 
306     @Override
307     public <T> T unwrap(final Class<T> iface) throws SQLException {
308         // TODO Auto-generated method stub
309         return null;
310     }
311 
312     @Override
313     public void addBatch() throws SQLException {
314         // TODO Auto-generated method stub
315 
316     }
317 
318     @Override
319     public void clearParameters() throws SQLException {
320         // TODO Auto-generated method stub
321 
322     }
323 
324     @Override
325     public boolean execute() throws SQLException {
326         // TODO Auto-generated method stub
327         return false;
328     }
329 
330     @Override
331     public ResultSet executeQuery() throws SQLException {
332         return new NullResultSet();
333     }
334 
335     @Override
336     public int executeUpdate() throws SQLException {
337         // TODO Auto-generated method stub
338         return 0;
339     }
340 
341     @Override
342     public ResultSetMetaData getMetaData() throws SQLException {
343         // TODO Auto-generated method stub
344         return null;
345     }
346 
347     @Override
348     public ParameterMetaData getParameterMetaData() throws SQLException {
349         // TODO Auto-generated method stub
350         return null;
351     }
352 
353     @Override
354     public void setArray(final int parameterIndex, final Array x) throws SQLException {
355         // TODO Auto-generated method stub
356 
357     }
358 
359     @Override
360     public void setAsciiStream(final int parameterIndex, final InputStream x) throws SQLException {
361         // TODO Auto-generated method stub
362 
363     }
364 
365     @Override
366     public void setAsciiStream(final int parameterIndex, final InputStream x, final int length) throws SQLException {
367         // TODO Auto-generated method stub
368 
369     }
370 
371     @Override
372     public void setAsciiStream(final int parameterIndex, final InputStream x, final long length) throws SQLException {
373         // TODO Auto-generated method stub
374 
375     }
376 
377     @Override
378     public void setBigDecimal(final int parameterIndex, final BigDecimal x) throws SQLException {
379         // TODO Auto-generated method stub
380 
381     }
382 
383     @Override
384     public void setBinaryStream(final int parameterIndex, final InputStream x) throws SQLException {
385         // TODO Auto-generated method stub
386 
387     }
388 
389     @Override
390     public void setBinaryStream(final int parameterIndex, final InputStream x, final int length) throws SQLException {
391         // TODO Auto-generated method stub
392 
393     }
394 
395     @Override
396     public void setBinaryStream(final int parameterIndex, final InputStream x, final long length) throws SQLException {
397         // TODO Auto-generated method stub
398 
399     }
400 
401     @Override
402     public void setBlob(final int parameterIndex, final Blob x) throws SQLException {
403         // TODO Auto-generated method stub
404 
405     }
406 
407     @Override
408     public void setBlob(final int parameterIndex, final InputStream inputStream) throws SQLException {
409         // TODO Auto-generated method stub
410 
411     }
412 
413     @Override
414     public void setBlob(final int parameterIndex, final InputStream inputStream, final long length) throws SQLException {
415         // TODO Auto-generated method stub
416 
417     }
418 
419     @Override
420     public void setBoolean(final int parameterIndex, final boolean x) throws SQLException {
421         // TODO Auto-generated method stub
422 
423     }
424 
425     @Override
426     public void setByte(final int parameterIndex, final byte x) throws SQLException {
427         // TODO Auto-generated method stub
428 
429     }
430 
431     @Override
432     public void setBytes(final int parameterIndex, final byte[] x) throws SQLException {
433         // TODO Auto-generated method stub
434 
435     }
436 
437     @Override
438     public void setCharacterStream(final int parameterIndex, final Reader reader) throws SQLException {
439         // TODO Auto-generated method stub
440 
441     }
442 
443     @Override
444     public void setCharacterStream(final int parameterIndex, final Reader reader, final int length) throws SQLException {
445         // TODO Auto-generated method stub
446 
447     }
448 
449     @Override
450     public void setCharacterStream(final int parameterIndex, final Reader reader, final long length) throws SQLException {
451         // TODO Auto-generated method stub
452 
453     }
454 
455     @Override
456     public void setClob(final int parameterIndex, final Clob x) throws SQLException {
457         // TODO Auto-generated method stub
458 
459     }
460 
461     @Override
462     public void setClob(final int parameterIndex, final Reader reader) throws SQLException {
463         // TODO Auto-generated method stub
464 
465     }
466 
467     @Override
468     public void setClob(final int parameterIndex, final Reader reader, final long length) throws SQLException {
469         // TODO Auto-generated method stub
470 
471     }
472 
473     @Override
474     public void setDate(final int parameterIndex, final Date x) throws SQLException {
475         // TODO Auto-generated method stub
476 
477     }
478 
479     @Override
480     public void setDate(final int parameterIndex, final Date x, final Calendar cal) throws SQLException {
481         // TODO Auto-generated method stub
482 
483     }
484 
485     @Override
486     public void setDouble(final int parameterIndex, final double x) throws SQLException {
487         // TODO Auto-generated method stub
488 
489     }
490 
491     @Override
492     public void setFloat(final int parameterIndex, final float x) throws SQLException {
493         // TODO Auto-generated method stub
494 
495     }
496 
497     @Override
498     public void setInt(final int parameterIndex, final int x) throws SQLException {
499         // TODO Auto-generated method stub
500 
501     }
502 
503     @Override
504     public void setLong(final int parameterIndex, final long x) throws SQLException {
505         // TODO Auto-generated method stub
506 
507     }
508 
509     @Override
510     public void setNCharacterStream(final int parameterIndex, final Reader value) throws SQLException {
511         // TODO Auto-generated method stub
512 
513     }
514 
515     @Override
516     public void setNCharacterStream(final int parameterIndex, final Reader value, final long length) throws SQLException {
517         // TODO Auto-generated method stub
518 
519     }
520 
521     @Override
522     public void setNClob(final int parameterIndex, final NClob value) throws SQLException {
523         // TODO Auto-generated method stub
524 
525     }
526 
527     @Override
528     public void setNClob(final int parameterIndex, final Reader reader) throws SQLException {
529         // TODO Auto-generated method stub
530 
531     }
532 
533     @Override
534     public void setNClob(final int parameterIndex, final Reader reader, final long length) throws SQLException {
535         // TODO Auto-generated method stub
536 
537     }
538 
539     @Override
540     public void setNString(final int parameterIndex, final String value) throws SQLException {
541         // TODO Auto-generated method stub
542 
543     }
544 
545     @Override
546     public void setNull(final int parameterIndex, final int sqlType) throws SQLException {
547         // TODO Auto-generated method stub
548 
549     }
550 
551     @Override
552     public void setNull(final int parameterIndex, final int sqlType, final String typeName) throws SQLException {
553         // TODO Auto-generated method stub
554 
555     }
556 
557     @Override
558     public void setObject(final int parameterIndex, final Object x) throws SQLException {
559         // TODO Auto-generated method stub
560 
561     }
562 
563     @Override
564     public void setObject(final int parameterIndex, final Object x, final int targetSqlType) throws SQLException {
565         // TODO Auto-generated method stub
566 
567     }
568 
569     @Override
570     public void setObject(final int parameterIndex, final Object x, final int targetSqlType, final int scaleOrLength) throws SQLException {
571         // TODO Auto-generated method stub
572 
573     }
574 
575     @Override
576     public void setRef(final int parameterIndex, final Ref x) throws SQLException {
577         // TODO Auto-generated method stub
578 
579     }
580 
581     @Override
582     public void setRowId(final int parameterIndex, final RowId x) throws SQLException {
583         // TODO Auto-generated method stub
584 
585     }
586 
587     @Override
588     public void setSQLXML(final int parameterIndex, final SQLXML xmlObject) throws SQLException {
589         // TODO Auto-generated method stub
590 
591     }
592 
593     @Override
594     public void setShort(final int parameterIndex, final short x) throws SQLException {
595         // TODO Auto-generated method stub
596 
597     }
598 
599     @Override
600     public void setString(final int parameterIndex, final String x) throws SQLException {
601         // TODO Auto-generated method stub
602 
603     }
604 
605     @Override
606     public void setTime(final int parameterIndex, final Time x) throws SQLException {
607         // TODO Auto-generated method stub
608 
609     }
610 
611     @Override
612     public void setTime(final int parameterIndex, final Time x, final Calendar cal) throws SQLException {
613         // TODO Auto-generated method stub
614 
615     }
616 
617     @Override
618     public void setTimestamp(final int parameterIndex, final Timestamp x) throws SQLException {
619         // TODO Auto-generated method stub
620 
621     }
622 
623     @Override
624     public void setTimestamp(final int parameterIndex, final Timestamp x, final Calendar cal) throws SQLException {
625         // TODO Auto-generated method stub
626 
627     }
628 
629     @Override
630     public void setURL(final int parameterIndex, final URL x) throws SQLException {
631         // TODO Auto-generated method stub
632 
633     }
634 
635     @Override
636     public void setUnicodeStream(final int parameterIndex, final InputStream x, final int length) throws SQLException {
637         // TODO Auto-generated method stub
638 
639     }
640 
641 }