001: /*
002: * Copyright (c) 1998-2008 Caucho Technology -- all rights reserved
003: *
004: * This file is part of Resin(R) Open Source
005: *
006: * Each copy or derived work must preserve the copyright notice and this
007: * notice unmodified.
008: *
009: * Resin Open Source is free software; you can redistribute it and/or modify
010: * it under the terms of the GNU General Public License as published by
011: * the Free Software Foundation; either version 2 of the License, or
012: * (at your option) any later version.
013: *
014: * Resin Open Source is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
017: * of NON-INFRINGEMENT. See the GNU General Public License for more
018: * details.
019: *
020: * You should have received a copy of the GNU General Public License
021: * along with Resin Open Source; if not, write to the
022: * Free Software Foundation, Inc.
023: * 59 Temple Place, Suite 330
024: * Boston, MA 02111-1307 USA
025: *
026: * @author Scott Ferguson
027: */
028:
029: package com.caucho.amber.jdbc;
030:
031: import java.sql.SQLException;
032: import java.sql.SQLWarning;
033: import java.sql.Statement;
034:
035: /**
036: * Amber wrapper of a statement.
037: */
038: public class AmberStatementImpl implements java.sql.Statement {
039: // The owning connection
040: protected AmberConnectionImpl _conn;
041:
042: // The underlying statement
043: protected Statement _stmt;
044:
045: AmberStatementImpl(AmberConnectionImpl conn, Statement stmt) {
046: _conn = conn;
047: _stmt = stmt;
048: }
049:
050: /**
051: * Returns the underlying statement.
052: */
053: public Statement getStatement() {
054: return _stmt;
055: }
056:
057: public void addBatch(String sql) throws SQLException {
058: _stmt.addBatch(sql);
059: }
060:
061: public void cancel() throws SQLException {
062: _stmt.cancel();
063: }
064:
065: public void clearBatch() throws SQLException {
066: _stmt.clearBatch();
067: }
068:
069: public void clearWarnings() throws SQLException {
070: _stmt.clearWarnings();
071: }
072:
073: public void close() throws SQLException {
074: _stmt.close();
075: }
076:
077: public java.sql.ResultSet executeQuery(String sql)
078: throws SQLException {
079: return _stmt.executeQuery(sql);
080: }
081:
082: public int executeUpdate(String sql) throws SQLException {
083: return _stmt.executeUpdate(sql);
084: }
085:
086: public boolean execute(String sql) throws SQLException {
087: return _stmt.execute(sql);
088: }
089:
090: public int[] executeBatch() throws SQLException {
091: return _stmt.executeBatch();
092: }
093:
094: public java.sql.ResultSet getResultSet() throws SQLException {
095: return _stmt.getResultSet();
096: }
097:
098: public int getUpdateCount() throws SQLException {
099: return _stmt.getUpdateCount();
100: }
101:
102: public java.sql.Connection getConnection() throws SQLException {
103: return _conn;
104: }
105:
106: public int getFetchDirection() throws SQLException {
107: return _stmt.getFetchDirection();
108: }
109:
110: public int getFetchSize() throws SQLException {
111: return _stmt.getFetchSize();
112: }
113:
114: public int getMaxFieldSize() throws SQLException {
115: return _stmt.getMaxFieldSize();
116: }
117:
118: public int getMaxRows() throws SQLException {
119: return _stmt.getMaxRows();
120: }
121:
122: public void setMaxRows(int max) throws SQLException {
123: _stmt.setMaxRows(max);
124: }
125:
126: public boolean getMoreResults() throws SQLException {
127: return _stmt.getMoreResults();
128: }
129:
130: public int getQueryTimeout() throws SQLException {
131: return _stmt.getQueryTimeout();
132: }
133:
134: public int getResultSetConcurrency() throws SQLException {
135: return _stmt.getResultSetConcurrency();
136: }
137:
138: public int getResultSetType() throws SQLException {
139: return _stmt.getResultSetType();
140: }
141:
142: public SQLWarning getWarnings() throws SQLException {
143: return _stmt.getWarnings();
144: }
145:
146: public void setCursorName(String name) throws SQLException {
147: _stmt.setCursorName(name);
148: }
149:
150: public void setEscapeProcessing(boolean enable) throws SQLException {
151: _stmt.setEscapeProcessing(enable);
152: }
153:
154: public void setFetchDirection(int direction) throws SQLException {
155: _stmt.setFetchDirection(direction);
156: }
157:
158: public void setFetchSize(int rows) throws SQLException {
159: _stmt.setFetchSize(rows);
160: }
161:
162: public void setMaxFieldSize(int max) throws SQLException {
163: _stmt.setMaxFieldSize(max);
164: }
165:
166: public void setQueryTimeout(int seconds) throws SQLException {
167: _stmt.setQueryTimeout(seconds);
168: }
169:
170: // jdk 1.4
171: public boolean getMoreResults(int count) throws SQLException {
172: return _stmt.getMoreResults(count);
173: }
174:
175: public java.sql.ResultSet getGeneratedKeys() throws SQLException {
176: return _stmt.getGeneratedKeys();
177: }
178:
179: public int executeUpdate(String query, int resultType)
180: throws SQLException {
181: return _stmt.executeUpdate(query, resultType);
182: }
183:
184: public int executeUpdate(String query, int[] columns)
185: throws SQLException {
186: return _stmt.executeUpdate(query, columns);
187: }
188:
189: public int executeUpdate(String query, String[] columns)
190: throws SQLException {
191: return _stmt.executeUpdate(query, columns);
192: }
193:
194: public boolean execute(String query, int resultType)
195: throws SQLException {
196: return _stmt.execute(query, resultType);
197: }
198:
199: public boolean execute(String query, int[] columns)
200: throws SQLException {
201: return _stmt.execute(query, columns);
202: }
203:
204: public boolean execute(String query, String[] columns)
205: throws SQLException {
206: return _stmt.execute(query, columns);
207: }
208:
209: public int getResultSetHoldability() throws SQLException {
210: return _stmt.getResultSetHoldability();
211: }
212:
213: public boolean isClosed() throws SQLException {
214: throw new UnsupportedOperationException("Not supported yet.");
215: }
216:
217: public void setPoolable(boolean poolable) throws SQLException {
218: throw new UnsupportedOperationException("Not supported yet.");
219: }
220:
221: public boolean isPoolable() throws SQLException {
222: throw new UnsupportedOperationException("Not supported yet.");
223: }
224:
225: public <T> T unwrap(Class<T> iface) throws SQLException {
226: throw new UnsupportedOperationException("Not supported yet.");
227: }
228:
229: public boolean isWrapperFor(Class<?> iface) throws SQLException {
230: throw new UnsupportedOperationException("Not supported yet.");
231: }
232: }
|