KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > iapi > jdbc > BrokeredCallableStatement


1 /*
2
3    Derby - Class org.apache.derby.iapi.jdbc.BrokeredCallableStatement
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to you under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20  */

21
22 package org.apache.derby.iapi.jdbc;
23
24 import java.sql.*;
25 import java.math.BigDecimal JavaDoc;
26
27 import java.util.Calendar JavaDoc;
28 import java.util.Map JavaDoc;
29
30
31 /**
32     JDBC 2 brokered CallableStatement
33  */

34 public class BrokeredCallableStatement extends BrokeredPreparedStatement
35           implements CallableStatement
36 {
37
38     public BrokeredCallableStatement(BrokeredStatementControl control, int jdbcLevel, String JavaDoc sql) throws SQLException {
39         super(control, jdbcLevel, sql);
40     }
41
42     public final void registerOutParameter(int parameterIndex,
43                                      int sqlType)
44         throws SQLException
45     {
46         getCallableStatement().registerOutParameter( parameterIndex, sqlType);
47     }
48
49     public final void registerOutParameter(int parameterIndex,
50                                      int sqlType,
51                                      int scale)
52         throws SQLException
53     {
54         getCallableStatement().registerOutParameter( parameterIndex, sqlType, scale);
55     }
56
57     public final boolean wasNull()
58         throws SQLException
59     {
60         return getCallableStatement().wasNull();
61     }
62
63     public final String JavaDoc getString(int parameterIndex)
64         throws SQLException
65     {
66         return getCallableStatement().getString( parameterIndex);
67     }
68
69     public final boolean getBoolean(int parameterIndex)
70         throws SQLException
71     {
72         return getCallableStatement().getBoolean( parameterIndex);
73     }
74
75     public final byte getByte(int parameterIndex)
76         throws SQLException
77     {
78         return getCallableStatement().getByte( parameterIndex);
79     }
80
81     public final short getShort(int parameterIndex)
82         throws SQLException
83     {
84         return getCallableStatement().getShort( parameterIndex);
85     }
86
87     public final int getInt(int parameterIndex)
88         throws SQLException
89     {
90         return getCallableStatement().getInt( parameterIndex);
91     }
92
93     public final long getLong(int parameterIndex)
94         throws SQLException
95     {
96         return getCallableStatement().getLong( parameterIndex);
97     }
98
99     public final float getFloat(int parameterIndex)
100         throws SQLException
101     {
102         return getCallableStatement().getFloat( parameterIndex);
103     }
104
105     public final double getDouble(int parameterIndex)
106         throws SQLException
107     {
108         return getCallableStatement().getDouble( parameterIndex);
109     }
110
111     public final BigDecimal JavaDoc getBigDecimal(int parameterIndex,
112                                               int scale)
113         throws SQLException
114     {
115         return getCallableStatement().getBigDecimal( parameterIndex, scale);
116     }
117
118     public final byte[] getBytes(int parameterIndex)
119         throws SQLException
120     {
121         return getCallableStatement().getBytes( parameterIndex);
122     }
123
124     public final Date getDate(int parameterIndex)
125         throws SQLException
126     {
127         return getCallableStatement().getDate( parameterIndex);
128     }
129
130     public final Date getDate(int parameterIndex,
131                         Calendar JavaDoc cal)
132         throws SQLException
133     {
134         return getCallableStatement().getDate( parameterIndex, cal);
135     }
136
137     public final Time getTime(int parameterIndex)
138         throws SQLException
139     {
140         return getCallableStatement().getTime( parameterIndex);
141     }
142
143     public final Timestamp getTimestamp(int parameterIndex)
144         throws SQLException
145     {
146         return getCallableStatement().getTimestamp( parameterIndex);
147     }
148
149     public final Object JavaDoc getObject(int parameterIndex)
150         throws SQLException
151     {
152         return getCallableStatement().getObject( parameterIndex);
153     }
154
155     public final BigDecimal JavaDoc getBigDecimal(int parameterIndex)
156         throws SQLException
157     {
158         return getCallableStatement().getBigDecimal( parameterIndex);
159     }
160
161     public final Object JavaDoc getObject(int i,
162                             Map JavaDoc map)
163         throws SQLException
164     {
165         return getCallableStatement().getObject( i, map);
166     }
167
168     public final Ref getRef(int i)
169         throws SQLException
170     {
171         return getCallableStatement().getRef( i);
172     }
173
174     public final Blob getBlob(int i)
175         throws SQLException
176     {
177         return getCallableStatement().getBlob( i);
178     }
179
180     public final Clob getClob(int i)
181         throws SQLException
182     {
183         return getCallableStatement().getClob( i);
184     }
185
186     public final Array getArray(int i)
187         throws SQLException
188     {
189         return getCallableStatement().getArray( i);
190     }
191
192     public final Time getTime(int parameterIndex,
193                         Calendar JavaDoc cal)
194         throws SQLException
195     {
196         return getCallableStatement().getTime( parameterIndex, cal);
197     }
198
199     public final Timestamp getTimestamp(int parameterIndex,
200                                   Calendar JavaDoc cal)
201         throws SQLException
202     {
203         return getCallableStatement().getTimestamp( parameterIndex, cal);
204     }
205
206     public final void registerOutParameter(int paramIndex,
207                                      int sqlType,
208                                      String JavaDoc typeName)
209         throws SQLException
210     {
211         getCallableStatement().registerOutParameter( paramIndex, sqlType, typeName);
212     }
213
214     /*
215     ** Control methods
216     */

217
218     /**
219      * Access the underlying CallableStatement. This method
220      * is package protected to restrict access to the underlying
221      * object to the brokered objects. Allowing the application to
222      * access the underlying object thtough a public method would
223      *
224      */

225     final CallableStatement getCallableStatement() throws SQLException {
226         return control.getRealCallableStatement();
227     }
228     
229     /**
230      * Access the underlying PreparedStatement. This method
231      * is package protected to restrict access to the underlying
232      * object to the brokered objects. Allowing the application to
233      * access the underlying object thtough a public method would
234      *
235      */

236     final PreparedStatement getPreparedStatement() throws SQLException {
237         return getCallableStatement();
238     }
239     /**
240         Create a duplicate CalableStatement to this, including state, from the passed in Connection.
241     */

242     public CallableStatement createDuplicateStatement(Connection conn, CallableStatement oldStatement) throws SQLException {
243
244         CallableStatement newStatement = conn.prepareCall(sql, resultSetType, resultSetConcurrency);
245
246         setStatementState(oldStatement, newStatement);
247
248         return newStatement;
249     }
250 }
251
Popular Tags