KickJava   Java API By Example, From Geeks To Geeks.

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


1 /**
2  * $RCSfile: PreparedStatementWrapper.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 import java.math.BigDecimal JavaDoc;
16 import java.io.InputStream JavaDoc;
17 import java.io.Reader JavaDoc;
18 import java.util.Calendar JavaDoc;
19 import java.net.URL JavaDoc;
20
21 /**
22  * An implementation of the PreparedStatement interface that wraps an underlying
23  * PreparedStatement object.
24  *
25  * @author Gaston Dombiak
26  */

27 public abstract class PreparedStatementWrapper extends StatementWrapper
28         implements PreparedStatement {
29
30     protected PreparedStatement pstmt;
31
32     public PreparedStatementWrapper(PreparedStatement pstmt) {
33         super(pstmt);
34         this.pstmt = pstmt;
35     }
36
37     public ResultSet executeQuery() throws SQLException {
38         return pstmt.executeQuery();
39     }
40
41     public int executeUpdate() throws SQLException {
42         return pstmt.executeUpdate();
43     }
44
45     public void setNull(int parameterIndex, int sqlType) throws SQLException {
46         pstmt.setNull(parameterIndex, sqlType);
47     }
48
49     public void setBoolean(int parameterIndex, boolean x) throws SQLException {
50         pstmt.setBoolean(parameterIndex, x);
51     }
52
53     public void setByte(int parameterIndex, byte x) throws SQLException {
54         pstmt.setByte(parameterIndex, x);
55     }
56
57     public void setShort(int parameterIndex, short x) throws SQLException {
58         pstmt.setShort(parameterIndex, x);
59     }
60
61     public void setInt(int parameterIndex, int x) throws SQLException {
62         pstmt.setInt(parameterIndex, x);
63     }
64
65     public void setLong(int parameterIndex, long x) throws SQLException {
66         pstmt.setLong(parameterIndex, x);
67     }
68
69     public void setFloat(int parameterIndex, float x) throws SQLException {
70         pstmt.setFloat(parameterIndex, x);
71     }
72
73     public void setDouble(int parameterIndex, double x) throws SQLException {
74         pstmt.setDouble(parameterIndex, x);
75     }
76
77     public void setBigDecimal(int parameterIndex, BigDecimal JavaDoc x) throws SQLException {
78         pstmt.setBigDecimal(parameterIndex, x);
79     }
80
81     public void setString(int parameterIndex, String JavaDoc x) throws SQLException {
82         pstmt.setString(parameterIndex, x);
83     }
84
85     public void setBytes(int parameterIndex, byte x[]) throws SQLException {
86         pstmt.setBytes(parameterIndex, x);
87     }
88
89     public void setDate(int parameterIndex, Date x) throws SQLException {
90         pstmt.setDate(parameterIndex, x);
91     }
92
93     public void setTime(int parameterIndex, Time x) throws SQLException {
94         pstmt.setTime(parameterIndex, x);
95     }
96
97     public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException {
98         pstmt.setTimestamp(parameterIndex, x);
99     }
100
101     public void setAsciiStream(int parameterIndex, InputStream JavaDoc x, int length) throws SQLException {
102         pstmt.setAsciiStream(parameterIndex, x, length);
103     }
104
105     @Deprecated JavaDoc public void setUnicodeStream(int parameterIndex, InputStream JavaDoc x, int length)
106             throws SQLException {
107         pstmt.setUnicodeStream(parameterIndex, x, length);
108     }
109
110     public void setBinaryStream(int parameterIndex, InputStream JavaDoc x, int length) throws SQLException {
111         pstmt.setBinaryStream(parameterIndex, x, length);
112     }
113
114     public void clearParameters() throws SQLException {
115         pstmt.clearParameters();
116     }
117
118     public void setObject(int parameterIndex, Object JavaDoc x, int targetSqlType, int scale)
119             throws SQLException {
120         pstmt.setObject(parameterIndex, x, targetSqlType, scale);
121     }
122
123     public void setObject(int parameterIndex, Object JavaDoc x, int targetSqlType) throws SQLException {
124         pstmt.setObject(parameterIndex, x, targetSqlType);
125     }
126
127     public void setObject(int parameterIndex, Object JavaDoc x) throws SQLException {
128         pstmt.setObject(parameterIndex, x);
129     }
130
131     public boolean execute() throws SQLException {
132         return pstmt.execute();
133     }
134
135     public void addBatch() throws SQLException {
136         pstmt.addBatch();
137     }
138
139     public void setCharacterStream(int parameterIndex, Reader JavaDoc reader, int length)
140             throws SQLException {
141         pstmt.setCharacterStream(parameterIndex, reader, length);
142     }
143
144     public void setRef(int i, Ref x) throws SQLException {
145         pstmt.setRef(i, x);
146     }
147
148     public void setBlob(int i, Blob x) throws SQLException {
149         pstmt.setBlob(i, x);
150     }
151
152     public void setClob(int i, Clob x) throws SQLException {
153         pstmt.setClob(i, x);
154     }
155
156     public void setArray(int i, Array x) throws SQLException {
157         pstmt.setArray(i, x);
158     }
159
160     public ResultSetMetaData getMetaData() throws SQLException {
161         return pstmt.getMetaData();
162     }
163
164     public void setDate(int parameterIndex, Date x, Calendar JavaDoc cal) throws SQLException {
165         pstmt.setDate(parameterIndex, x, cal);
166     }
167
168     public void setTime(int parameterIndex, Time x, Calendar JavaDoc cal) throws SQLException {
169         pstmt.setTime(parameterIndex, x, cal);
170     }
171
172     public void setTimestamp(int parameterIndex, Timestamp x, Calendar JavaDoc cal) throws SQLException {
173         pstmt.setTimestamp(parameterIndex, x, cal);
174     }
175
176     public void setNull(int paramIndex, int sqlType, String JavaDoc typeName) throws SQLException {
177         pstmt.setNull(paramIndex, sqlType, typeName);
178     }
179
180     public void setURL(int parameterIndex, URL JavaDoc x) throws SQLException {
181         pstmt.setURL(parameterIndex, x);
182     }
183
184     public ParameterMetaData getParameterMetaData() throws SQLException {
185         return pstmt.getParameterMetaData();
186     }
187 }
188
Popular Tags