KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > caucho > amber > jdbc > AmberStatementImpl


1 /*
2  * Copyright (c) 1998-2006 Caucho Technology -- all rights reserved
3  *
4  * This file is part of Resin(R) Open Source
5  *
6  * Each copy or derived work must preserve the copyright notice and this
7  * notice unmodified.
8  *
9  * Resin Open Source is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * Resin Open Source is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
17  * of NON-INFRINGEMENT. See the GNU General Public License for more
18  * details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with Resin Open Source; if not, write to the
22  * Free Software Foundation, Inc.
23  * 59 Temple Place, Suite 330
24  * Boston, MA 02111-1307 USA
25  *
26  * @author Scott Ferguson
27  */

28
29 package com.caucho.amber.jdbc;
30
31 import java.sql.SQLException JavaDoc;
32 import java.sql.SQLWarning JavaDoc;
33 import java.sql.Statement JavaDoc;
34
35 /**
36  * Amber wrapper of a statement.
37  */

38 public class AmberStatementImpl implements java.sql.Statement JavaDoc {
39   // The owning connection
40
protected AmberConnectionImpl _conn;
41   
42   // The underlying statement
43
protected Statement JavaDoc _stmt;
44
45   AmberStatementImpl(AmberConnectionImpl conn, Statement JavaDoc stmt)
46   {
47     _conn = conn;
48     _stmt = stmt;
49   }
50
51   /**
52    * Returns the underlying statement.
53    */

54   public Statement JavaDoc getStatement()
55   {
56     return _stmt;
57   }
58
59   public void addBatch(String JavaDoc sql)
60     throws SQLException JavaDoc
61   {
62     _stmt.addBatch(sql);
63   }
64
65   public void cancel()
66     throws SQLException JavaDoc
67   {
68     _stmt.cancel();
69   }
70   
71   public void clearBatch()
72     throws SQLException JavaDoc
73   {
74     _stmt.clearBatch();
75   }
76
77   public void clearWarnings()
78     throws SQLException JavaDoc
79   {
80     _stmt.clearWarnings();
81   }
82
83   public void close()
84     throws SQLException JavaDoc
85   {
86     _stmt.close();
87   }
88
89   public java.sql.ResultSet JavaDoc executeQuery(String JavaDoc sql)
90     throws SQLException JavaDoc
91   {
92     return _stmt.executeQuery(sql);
93   }
94
95   public int executeUpdate(String JavaDoc sql)
96     throws SQLException JavaDoc
97   {
98     return _stmt.executeUpdate(sql);
99   }
100
101   public boolean execute(String JavaDoc sql)
102     throws SQLException JavaDoc
103   {
104     return _stmt.execute(sql);
105   }
106
107   public int[]executeBatch()
108     throws SQLException JavaDoc
109   {
110     return _stmt.executeBatch();
111   }
112
113   public java.sql.ResultSet JavaDoc getResultSet()
114     throws SQLException JavaDoc
115   {
116     return _stmt.getResultSet();
117   }
118
119   public int getUpdateCount()
120     throws SQLException JavaDoc
121   {
122     return _stmt.getUpdateCount();
123   }
124
125   public java.sql.Connection JavaDoc getConnection()
126     throws SQLException JavaDoc
127   {
128     return _conn;
129   }
130
131   public int getFetchDirection()
132     throws SQLException JavaDoc
133   {
134     return _stmt.getFetchDirection();
135   }
136
137   public int getFetchSize()
138     throws SQLException JavaDoc
139   {
140     return _stmt.getFetchSize();
141   }
142
143   public int getMaxFieldSize()
144     throws SQLException JavaDoc
145   {
146     return _stmt.getMaxFieldSize();
147   }
148
149   public int getMaxRows()
150     throws SQLException JavaDoc
151   {
152     return _stmt.getMaxRows();
153   }
154   
155   public void setMaxRows(int max)
156     throws SQLException JavaDoc
157   {
158     _stmt.setMaxRows(max);
159   }
160
161   public boolean getMoreResults()
162     throws SQLException JavaDoc
163   {
164     return _stmt.getMoreResults();
165   }
166
167   public int getQueryTimeout()
168     throws SQLException JavaDoc
169   {
170     return _stmt.getQueryTimeout();
171   }
172
173   public int getResultSetConcurrency()
174     throws SQLException JavaDoc
175   {
176     return _stmt.getResultSetConcurrency();
177   }
178
179   public int getResultSetType()
180     throws SQLException JavaDoc
181   {
182     return _stmt.getResultSetType();
183   }
184
185   public SQLWarning JavaDoc getWarnings()
186     throws SQLException JavaDoc
187   {
188     return _stmt.getWarnings();
189   }
190
191   public void setCursorName(String JavaDoc name)
192     throws SQLException JavaDoc
193   {
194     _stmt.setCursorName(name);
195   }
196
197   public void setEscapeProcessing(boolean enable)
198     throws SQLException JavaDoc
199   {
200     _stmt.setEscapeProcessing(enable);
201   }
202
203   public void setFetchDirection(int direction)
204     throws SQLException JavaDoc
205   {
206     _stmt.setFetchDirection(direction);
207   }
208
209   public void setFetchSize(int rows)
210     throws SQLException JavaDoc
211   {
212     _stmt.setFetchSize(rows);
213   }
214
215   public void setMaxFieldSize(int max)
216     throws SQLException JavaDoc
217   {
218     _stmt.setMaxFieldSize(max);
219   }
220   
221   public void setQueryTimeout(int seconds)
222     throws SQLException JavaDoc
223   {
224     _stmt.setQueryTimeout(seconds);
225   }
226
227   // jdk 1.4
228
public boolean getMoreResults(int count)
229     throws SQLException JavaDoc
230   {
231     return _stmt.getMoreResults(count);
232   }
233   
234   public java.sql.ResultSet JavaDoc getGeneratedKeys()
235     throws SQLException JavaDoc
236   {
237     return _stmt.getGeneratedKeys();
238   }
239   
240   public int executeUpdate(String JavaDoc query, int resultType)
241     throws SQLException JavaDoc
242   {
243     return _stmt.executeUpdate(query, resultType);
244   }
245   
246   public int executeUpdate(String JavaDoc query, int []columns)
247     throws SQLException JavaDoc
248   {
249     return _stmt.executeUpdate(query, columns);
250   }
251   
252   public int executeUpdate(String JavaDoc query, String JavaDoc []columns)
253     throws SQLException JavaDoc
254   {
255     return _stmt.executeUpdate(query, columns);
256   }
257   
258   public boolean execute(String JavaDoc query, int resultType)
259     throws SQLException JavaDoc
260   {
261     return _stmt.execute(query, resultType);
262   }
263   
264   public boolean execute(String JavaDoc query, int []columns)
265     throws SQLException JavaDoc
266   {
267     return _stmt.execute(query, columns);
268   }
269   
270   public boolean execute(String JavaDoc query, String JavaDoc []columns)
271     throws SQLException JavaDoc
272   {
273     return _stmt.execute(query, columns);
274   }
275
276   public int getResultSetHoldability()
277     throws SQLException JavaDoc
278   {
279     return _stmt.getResultSetHoldability();
280   }
281 }
282
Popular Tags