KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > jca > jdbc > TestStatement


1 /*
2   * JBoss, Home of Professional Open Source
3   * Copyright 2005, JBoss Inc., and individual contributors as indicated
4   * by the @authors tag. See the copyright.txt in the distribution for a
5   * full listing of individual contributors.
6   *
7   * This is free software; you can redistribute it and/or modify it
8   * under the terms of the GNU Lesser General Public License as
9   * published by the Free Software Foundation; either version 2.1 of
10   * the License, or (at your option) any later version.
11   *
12   * This software is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this software; if not, write to the Free
19   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21   */

22 package org.jboss.test.jca.jdbc;
23
24 import java.sql.Connection JavaDoc;
25 import java.sql.ResultSet JavaDoc;
26 import java.sql.SQLException JavaDoc;
27 import java.sql.SQLWarning JavaDoc;
28 import java.sql.Statement JavaDoc;
29
30
31 /**
32  * TestStatement.java
33  *
34  *
35  * Created: Sat Apr 20 14:29:19 2002
36  *
37  * @author <a HREF="mailto:d_jencks@users.sourceforge.net">David Jencks</a>
38  * @version
39  */

40
41 public class TestStatement
42    implements Statement JavaDoc
43 {
44    private final TestDriver driver;
45
46    int queryTimeout = 0;
47    
48    public TestStatement(final TestDriver driver)
49    {
50       this.driver = driver;
51    }
52    // implementation of java.sql.Statement interface
53

54    /**
55     *
56     * @exception java.sql.SQLException <description>
57     */

58    public void close() throws SQLException JavaDoc
59    {
60    }
61
62    /**
63     *
64     * @param param1 <description>
65     * @return <description>
66     * @exception java.sql.SQLException <description>
67     */

68    public boolean execute(String JavaDoc sql) throws SQLException JavaDoc
69    {
70       if (driver.getFail())
71       {
72          throw new SQLException JavaDoc("asked to fail");
73       } // end of if ()
74
return false;
75
76    }
77
78    /**
79     *
80     * @param param1 <description>
81     * @param param2 <description>
82     * @return <description>
83     * @exception java.sql.SQLException <description>
84     */

85    public boolean execute(String JavaDoc sql, int autoGeneratedKeys) throws SQLException JavaDoc
86    {
87       return execute(sql);
88    }
89
90    /**
91     *
92     * @param param1 <description>
93     * @param param2 <description>
94     * @return <description>
95     * @exception java.sql.SQLException <description>
96     */

97    public boolean execute(String JavaDoc sql, int[] columnIndexes) throws SQLException JavaDoc
98    {
99       return execute(sql);
100    }
101
102    /**
103     *
104     * @param param1 <description>
105     * @param param2 <description>
106     * @return <description>
107     * @exception java.sql.SQLException <description>
108     */

109    public boolean execute(String JavaDoc sql, String JavaDoc[]columnNames ) throws SQLException JavaDoc
110    {
111       return execute(sql);
112    }
113
114    /**
115     *
116     * @return <description>
117     * @exception java.sql.SQLException <description>
118     */

119    public Connection JavaDoc getConnection() throws SQLException JavaDoc
120    {
121       return null;
122    }
123
124    /**
125     *
126     * @return <description>
127     * @exception java.sql.SQLException <description>
128     */

129    public SQLWarning JavaDoc getWarnings() throws SQLException JavaDoc
130    {
131       return null;
132    }
133
134    /**
135     *
136     * @exception java.sql.SQLException <description>
137     */

138    public void clearWarnings() throws SQLException JavaDoc
139    {
140    }
141
142    /**
143     *
144     * @param param1 <description>
145     * @return <description>
146     * @exception java.sql.SQLException <description>
147     */

148    public ResultSet JavaDoc executeQuery(String JavaDoc sql) throws SQLException JavaDoc
149    {
150       execute(sql);
151       return null;
152    }
153
154    /**
155     *
156     * @param param1 <description>
157     * @return <description>
158     * @exception java.sql.SQLException <description>
159     */

160    public int executeUpdate(String JavaDoc sql) throws SQLException JavaDoc
161    {
162       execute(sql);
163       return 0;
164    }
165
166    /**
167     *
168     * @param param1 <description>
169     * @param param2 <description>
170     * @return <description>
171     * @exception java.sql.SQLException <description>
172     */

173    public int executeUpdate(String JavaDoc sql, int autoGeneratedKeys) throws SQLException JavaDoc
174    {
175       return executeUpdate(sql);
176    }
177
178    /**
179     *
180     * @param param1 <description>
181     * @param param2 <description>
182     * @return <description>
183     * @exception java.sql.SQLException <description>
184     */

185    public int executeUpdate(String JavaDoc sql, int[] columnIndexes) throws SQLException JavaDoc
186    {
187       return executeUpdate(sql);
188    }
189
190    /**
191     *
192     * @param param1 <description>
193     * @param param2 <description>
194     * @return <description>
195     * @exception java.sql.SQLException <description>
196     */

197    public int executeUpdate(String JavaDoc sql, String JavaDoc[] columnNames) throws SQLException JavaDoc
198    {
199       return executeUpdate(sql);
200    }
201
202    /**
203     *
204     * @return <description>
205     * @exception java.sql.SQLException <description>
206     */

207    public int getMaxFieldSize() throws SQLException JavaDoc
208    {
209       return 0;
210    }
211
212    /**
213     *
214     * @param param1 <description>
215     * @exception java.sql.SQLException <description>
216     */

217    public void setMaxFieldSize(int max) throws SQLException JavaDoc
218    {
219    }
220
221    /**
222     *
223     * @return <description>
224     * @exception java.sql.SQLException <description>
225     */

226    public int getMaxRows() throws SQLException JavaDoc
227    {
228       return 0;
229    }
230
231    /**
232     *
233     * @param param1 <description>
234     * @exception java.sql.SQLException <description>
235     */

236    public void setMaxRows(int max) throws SQLException JavaDoc
237    {
238    }
239
240    /**
241     *
242     * @param param1 <description>
243     * @exception java.sql.SQLException <description>
244     */

245    public void setEscapeProcessing(boolean enable) throws SQLException JavaDoc
246    {
247    }
248
249    /**
250     *
251     * @return <description>
252     * @exception java.sql.SQLException <description>
253     */

254    public int getQueryTimeout() throws SQLException JavaDoc
255    {
256       return queryTimeout;
257    }
258
259    /**
260     *
261     * @param param1 <description>
262     * @exception java.sql.SQLException <description>
263     */

264    public void setQueryTimeout(int timeout) throws SQLException JavaDoc
265    {
266       this.queryTimeout = timeout;
267    }
268
269    /**
270     *
271     * @exception java.sql.SQLException <description>
272     */

273    public void cancel() throws SQLException JavaDoc
274    {
275    }
276
277    /**
278     *
279     * @param param1 <description>
280     * @exception java.sql.SQLException <description>
281     */

282    public void setCursorName(String JavaDoc name) throws SQLException JavaDoc
283    {
284    }
285
286    /**
287     *
288     * @return <description>
289     * @exception java.sql.SQLException <description>
290     */

291    public ResultSet JavaDoc getResultSet() throws SQLException JavaDoc
292    {
293       return null;
294    }
295
296    /**
297     *
298     * @return <description>
299     * @exception java.sql.SQLException <description>
300     */

301    public int getUpdateCount() throws SQLException JavaDoc
302    {
303       return 0;
304    }
305
306    /**
307     *
308     * @return <description>
309     * @exception java.sql.SQLException <description>
310     */

311    public boolean getMoreResults() throws SQLException JavaDoc
312    {
313       return false;
314    }
315
316    /**
317     *
318     * @param param1 <description>
319     * @return <description>
320     * @exception java.sql.SQLException <description>
321     */

322    public boolean getMoreResults(int current) throws SQLException JavaDoc
323    {
324       return false;
325    }
326
327    /**
328     *
329     * @param param1 <description>
330     * @exception java.sql.SQLException <description>
331     */

332    public void setFetchDirection(int direction) throws SQLException JavaDoc
333    {
334    }
335
336    /**
337     *
338     * @return <description>
339     * @exception java.sql.SQLException <description>
340     */

341    public int getFetchDirection() throws SQLException JavaDoc
342    {
343       return 0;
344    }
345
346    /**
347     *
348     * @param param1 <description>
349     * @exception java.sql.SQLException <description>
350     */

351    public void setFetchSize(int rows) throws SQLException JavaDoc
352    {
353    }
354
355    /**
356     *
357     * @return <description>
358     * @exception java.sql.SQLException <description>
359     */

360    public int getFetchSize() throws SQLException JavaDoc
361    {
362       return 0;
363    }
364
365    /**
366     *
367     * @return <description>
368     * @exception java.sql.SQLException <description>
369     */

370    public int getResultSetConcurrency() throws SQLException JavaDoc
371    {
372       return 0;
373    }
374
375    /**
376     *
377     * @return <description>
378     * @exception java.sql.SQLException <description>
379     */

380    public int getResultSetType() throws SQLException JavaDoc
381    {
382       return 0;
383    }
384
385    /**
386     *
387     * @param param1 <description>
388     * @exception java.sql.SQLException <description>
389     */

390    public void addBatch(String JavaDoc sql) throws SQLException JavaDoc
391    {
392    }
393
394    /**
395     *
396     * @exception java.sql.SQLException <description>
397     */

398    public void clearBatch() throws SQLException JavaDoc
399    {
400    }
401
402    /**
403     *
404     * @return <description>
405     * @exception java.sql.SQLException <description>
406     */

407    public int[] executeBatch() throws SQLException JavaDoc
408    {
409       return null;
410    }
411
412    /**
413     *
414     * @return <description>
415     * @exception java.sql.SQLException <description>
416     */

417    public ResultSet JavaDoc getGeneratedKeys() throws SQLException JavaDoc
418    {
419       return null;
420    }
421
422    /**
423     *
424     * @return <description>
425     * @exception java.sql.SQLException <description>
426     */

427    public int getResultSetHoldability() throws SQLException JavaDoc
428    {
429       return 0;
430    }
431
432
433 }// LocalStatement
434
Popular Tags