KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jivesoftware > database > StatementWrapper


1 /**
2  * $RCSfile: StatementWrapper.java,v $
3  * $Revision: 1.1 $
4  * $Date: 2004/10/21 06:08:42 $
5  *
6  * Copyright (C) 2004 Jive Software. All rights reserved.
7  *
8  * This software is published under the terms of the GNU Public License (GPL),
9  * a copy of which is included in this distribution.
10  */

11
12 package org.jivesoftware.database;
13
14 import java.sql.*;
15
16 /**
17  * An implementation of the Statement interface that wraps an underlying
18  * Statement object.
19  *
20  * @author Gaston Dombiak
21  */

22 public abstract class StatementWrapper implements Statement {
23
24     protected Statement stmt;
25
26     /**
27      * Creates a new StatementWrapper that wraps <tt>stmt</tt>.
28      *
29      * @param stmt
30      */

31     public StatementWrapper(Statement stmt) {
32         this.stmt = stmt;
33     }
34
35     public ResultSet executeQuery(String JavaDoc sql) throws SQLException {
36         return stmt.executeQuery(sql);
37     }
38
39     public int executeUpdate(String JavaDoc sql) throws SQLException {
40         return stmt.executeUpdate(sql);
41     }
42
43     public void close() throws SQLException {
44         stmt.close();
45     }
46
47     public int getMaxFieldSize() throws SQLException {
48         return stmt.getMaxFieldSize();
49     }
50
51     public void setMaxFieldSize(int max) throws SQLException {
52         stmt.setMaxFieldSize(max);
53     }
54
55     public int getMaxRows() throws SQLException {
56         return stmt.getMaxRows();
57     }
58
59     public void setMaxRows(int max) throws SQLException {
60         stmt.setMaxRows(max);
61     }
62
63     public void setEscapeProcessing(boolean enable) throws SQLException {
64         stmt.setEscapeProcessing(enable);
65     }
66
67     public int getQueryTimeout() throws SQLException {
68         return stmt.getQueryTimeout();
69     }
70
71     public void setQueryTimeout(int seconds) throws SQLException {
72         stmt.setQueryTimeout(seconds);
73     }
74
75     public void cancel() throws SQLException {
76         stmt.cancel();
77     }
78
79     public SQLWarning getWarnings() throws SQLException {
80         return stmt.getWarnings();
81     }
82
83     public void clearWarnings() throws SQLException {
84         stmt.clearWarnings();
85     }
86
87     public void setCursorName(String JavaDoc name) throws SQLException {
88         stmt.setCursorName(name);
89     }
90
91     public boolean execute(String JavaDoc sql) throws SQLException {
92         return stmt.execute(sql);
93     }
94
95     public ResultSet getResultSet() throws SQLException {
96         return stmt.getResultSet();
97     }
98
99     public int getUpdateCount() throws SQLException {
100         return stmt.getUpdateCount();
101     }
102
103     public boolean getMoreResults() throws SQLException {
104         return stmt.getMoreResults();
105     }
106
107     public void setFetchDirection(int direction) throws SQLException {
108         stmt.setFetchDirection(direction);
109     }
110
111     public int getFetchDirection() throws SQLException {
112         return stmt.getFetchDirection();
113     }
114
115     public void setFetchSize(int rows) throws SQLException {
116         stmt.setFetchSize(rows);
117     }
118
119     public int getFetchSize() throws SQLException {
120         return stmt.getFetchSize();
121     }
122
123     public int getResultSetConcurrency() throws SQLException {
124         return stmt.getResultSetConcurrency();
125     }
126
127     public int getResultSetType() throws SQLException {
128         return stmt.getResultSetType();
129     }
130
131     public void addBatch(String JavaDoc sql) throws SQLException {
132         stmt.addBatch(sql);
133     }
134
135     public void clearBatch() throws SQLException {
136         stmt.clearBatch();
137     }
138
139     public int[] executeBatch() throws SQLException {
140         return stmt.executeBatch();
141     }
142
143     public Connection getConnection() throws SQLException {
144         return stmt.getConnection();
145     }
146
147     public boolean getMoreResults(int current) throws SQLException {
148         return stmt.getMoreResults(current);
149     }
150
151     public ResultSet getGeneratedKeys() throws SQLException {
152         return stmt.getGeneratedKeys();
153     }
154
155     public int executeUpdate(String JavaDoc sql, int autoGeneratedKeys) throws SQLException {
156         return stmt.executeUpdate(sql, autoGeneratedKeys);
157     }
158
159     public int executeUpdate(String JavaDoc sql, int columnIndexes[]) throws SQLException {
160         return stmt.executeUpdate(sql, columnIndexes);
161     }
162
163     public int executeUpdate(String JavaDoc sql, String JavaDoc columnNames[]) throws SQLException {
164         return stmt.executeUpdate(sql, columnNames);
165     }
166
167     public boolean execute(String JavaDoc sql, int autoGeneratedKeys) throws SQLException {
168         return stmt.execute(sql, autoGeneratedKeys);
169     }
170
171     public boolean execute(String JavaDoc sql, int columnIndexes[]) throws SQLException {
172         return stmt.execute(sql, columnIndexes);
173     }
174
175     public boolean execute(String JavaDoc sql, String JavaDoc columnNames[]) throws SQLException {
176         return stmt.execute(sql, columnNames);
177     }
178
179     public int getResultSetHoldability() throws SQLException {
180         return stmt.getResultSetHoldability();
181     }
182 }
183
Popular Tags