KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > client > am > CallableStatement40


1 /*
2  
3    Derby - Class org.apache.derby.client.am.CallableStatement40
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.client.am;
23
24 import java.io.InputStream JavaDoc;
25 import java.io.Reader JavaDoc;
26 import java.sql.Blob JavaDoc;
27 import java.sql.Clob JavaDoc;
28 import java.sql.NClob JavaDoc;
29 import java.sql.RowId JavaDoc;
30 import java.sql.SQLException JavaDoc;
31 import java.sql.SQLXML JavaDoc;
32 import org.apache.derby.client.ClientPooledConnection;
33 import org.apache.derby.client.am.SqlException;
34 import org.apache.derby.client.am.ClientMessageId;
35 import org.apache.derby.shared.common.reference.SQLState;
36
37
38 public class CallableStatement40 extends org.apache.derby.client.am.CallableStatement {
39     
40     /**
41      * Calls the superclass constructor and passes the parameters
42      *
43      * @param agent The instance of NetAgent associated with this
44      * CallableStatement object.
45      * @param connection The connection object associated with this
46      * PreparedStatement Object.
47      * @param sql A String object that is the SQL statement to be sent
48      * to the database.
49      * @param type One of the ResultSet type constants
50      * @param concurrency One of the ResultSet concurrency constants
51      * @param holdability One of the ResultSet holdability constants
52      * @param cpc The PooledConnection object that will be used to
53      * notify the PooledConnection reference of the Error
54      * Occurred and the Close events.
55      * @throws SqlException
56      */

57     public CallableStatement40(Agent agent,
58         Connection connection,
59         String JavaDoc sql,
60         int type, int concurrency, int holdability,
61         ClientPooledConnection cpc) throws SqlException {
62         super(agent, connection, sql, type, concurrency, holdability,cpc);
63     }
64     
65     public Reader JavaDoc getCharacterStream(String JavaDoc parameterName)
66         throws SQLException JavaDoc {
67         throw SQLExceptionFactory.notImplemented("getCharacterStream(String)");
68     }
69
70     public Reader JavaDoc getNCharacterStream(int parameterIndex)
71         throws SQLException JavaDoc {
72         throw SQLExceptionFactory.notImplemented("getNCharacterStream(int)");
73     }
74     
75     public Reader JavaDoc getNCharacterStream(String JavaDoc parameterName)
76         throws SQLException JavaDoc {
77         throw SQLExceptionFactory.notImplemented(
78                 "getNCharacterStream(String)");
79     }
80
81     public String JavaDoc getNString(int parameterIndex)
82         throws SQLException JavaDoc {
83         throw SQLExceptionFactory.notImplemented("getNString(int)");
84     }
85
86     public String JavaDoc getNString(String JavaDoc parameterIndex)
87         throws SQLException JavaDoc {
88         throw SQLExceptionFactory.notImplemented("getNString(String)");
89     }
90
91     public RowId JavaDoc getRowId(int parameterIndex) throws SQLException JavaDoc {
92         throw SQLExceptionFactory.notImplemented ("getRowId (int)");
93     }
94     
95     public RowId JavaDoc getRowId(String JavaDoc parameterName) throws SQLException JavaDoc {
96         throw SQLExceptionFactory.notImplemented ("getRowId (String)");
97     }
98     
99     public void setRowId(String JavaDoc parameterName, RowId JavaDoc x) throws SQLException JavaDoc {
100         throw SQLExceptionFactory.notImplemented ("setRowId (String, RowId)");
101     }
102     
103     public void setBlob(String JavaDoc parameterName, Blob x)
104         throws SQLException JavaDoc {
105         throw SQLExceptionFactory.notImplemented("setBlob(String, Blob)");
106     }
107     
108     public void setClob(String JavaDoc parameterName, Clob x)
109         throws SQLException JavaDoc {
110         throw SQLExceptionFactory.notImplemented("setClob(String, Clob)");
111     }
112     
113     public void setNString(String JavaDoc parameterName, String JavaDoc value)
114     throws SQLException JavaDoc {
115         throw SQLExceptionFactory.notImplemented ("setNString (String, String)");
116     }
117     
118     public void setNCharacterStream(String JavaDoc parameterName, Reader JavaDoc value, long length)
119     throws SQLException JavaDoc {
120         throw SQLExceptionFactory.notImplemented (
121                 "setNString (String, Reader, long)");
122     }
123     
124     public void setNClob(String JavaDoc parameterName, NClob JavaDoc value) throws SQLException JavaDoc {
125         throw SQLExceptionFactory.notImplemented ("setNClob (String, NClob)");
126     }
127     
128     public void setClob(String JavaDoc parameterName, Reader JavaDoc reader, long length)
129     throws SQLException JavaDoc{
130         throw SQLExceptionFactory.notImplemented ("setClob (String, Reader, long)");
131         
132     }
133     
134     public void setBlob(String JavaDoc parameterName, InputStream JavaDoc inputStream, long length)
135     throws SQLException JavaDoc{
136         throw SQLExceptionFactory.notImplemented ("setBlob (String, InputStream, long)");
137     }
138     
139     public void setNClob(String JavaDoc parameterName, Reader JavaDoc reader, long length)
140     throws SQLException JavaDoc {
141         throw SQLExceptionFactory.notImplemented ("setNClob (String, Reader, long)");
142     }
143     
144     public NClob JavaDoc getNClob(int i) throws SQLException JavaDoc {
145         throw SQLExceptionFactory.notImplemented ("setNClob (int)");
146     }
147     
148     
149     public NClob JavaDoc getNClob(String JavaDoc parameterName) throws SQLException JavaDoc {
150         throw SQLExceptionFactory.notImplemented ("setNClob (String)");
151     }
152     
153     public void setSQLXML(String JavaDoc parameterName, SQLXML JavaDoc xmlObject) throws SQLException JavaDoc {
154         throw SQLExceptionFactory.notImplemented ("setSQLXML (String, SQLXML)");
155         
156     }
157     
158     public SQLXML JavaDoc getSQLXML(int parameterIndex) throws SQLException JavaDoc {
159         throw SQLExceptionFactory.notImplemented ("getSQLXML (int)");
160     }
161     
162     public SQLXML JavaDoc getSQLXML(String JavaDoc parametername) throws SQLException JavaDoc {
163         throw SQLExceptionFactory.notImplemented ("getSQLXML (String)");
164     }
165     
166     public void setRowId(int parameterIndex, RowId JavaDoc x) throws SQLException JavaDoc{
167         throw SQLExceptionFactory.notImplemented ("setRowId (int, RowId)");
168     }
169     
170     /**************************************************************************
171      * The methods from PreparedStatement for JDBC 4.0. *
172      * These are added here because we can't inherit *
173      * PreparedStatement40.java. Instead of moving the non-implemented *
174      * classes to PreparedStatement.java, we duplicate them here. *
175      **************************************************************************/

176     public void setNString(int index, String JavaDoc value) throws SQLException JavaDoc {
177         throw SQLExceptionFactory.notImplemented ("setNString (int, String)");
178     }
179     
180     public void setNCharacterStream(int parameterIndex, Reader JavaDoc value)
181             throws SQLException JavaDoc {
182         throw SQLExceptionFactory.notImplemented("setNCharacterStream" +
183                 "(int,Reader)");
184     }
185
186     public void setNCharacterStream(int index, Reader JavaDoc value, long length) throws SQLException JavaDoc {
187         throw SQLExceptionFactory.notImplemented ("setNCharacterStream " +
188                 "(int,Reader,long)");
189     }
190     
191     public void setNClob(int index, NClob JavaDoc value) throws SQLException JavaDoc {
192         throw SQLExceptionFactory.notImplemented ("setNClob (int, NClob)");
193     }
194     
195     public void setNClob(int parameterIndex, Reader JavaDoc reader)
196             throws SQLException JavaDoc {
197         throw SQLExceptionFactory.notImplemented("setNClob(int,Reader)");
198     }
199
200     public void setNClob(int parameterIndex, Reader JavaDoc reader, long length)
201     throws SQLException JavaDoc {
202         throw SQLExceptionFactory.notImplemented ("setNClob (int, " +
203                 "Reader, long)");
204     }
205     
206     public void setSQLXML(int parameterIndex, SQLXML JavaDoc xmlObject) throws SQLException JavaDoc {
207         throw SQLExceptionFactory.notImplemented ("setSQLXML (int, SQLXML)");
208     }
209
210     /**************************************************************************
211      * End of methods from PreparedStatement for JDBC 4.0. *
212      **************************************************************************/

213
214     public void setAsciiStream(String JavaDoc parameterName, InputStream JavaDoc x)
215             throws SQLException JavaDoc {
216         throw SQLExceptionFactory.notImplemented(
217                 "setAsciiStream(String,InputStream)");
218     }
219
220     public void setBinaryStream(String JavaDoc parameterName, InputStream JavaDoc x)
221             throws SQLException JavaDoc {
222         throw SQLExceptionFactory.notImplemented(
223                 "setBinaryStream(String,InputStream)");
224     }
225
226     public void setBlob(String JavaDoc parameterName, InputStream JavaDoc inputStream)
227             throws SQLException JavaDoc {
228         throw SQLExceptionFactory.notImplemented(
229                 "setBlob(String,InputStream)");
230     }
231
232     public void setCharacterStream(String JavaDoc parameterName, Reader JavaDoc reader)
233             throws SQLException JavaDoc {
234         throw SQLExceptionFactory.notImplemented(
235                 "setCharacterStream(String,Reader)");
236     }
237
238     public void setClob(String JavaDoc parameterName, Reader JavaDoc reader)
239             throws SQLException JavaDoc {
240         throw SQLExceptionFactory.notImplemented("setClob(String,Reader)");
241     }
242
243     public void setNCharacterStream(String JavaDoc parameterName, Reader JavaDoc value)
244             throws SQLException JavaDoc {
245         throw SQLExceptionFactory.notImplemented(
246                 "setNCharacterStream(String,Reader)");
247     }
248
249     public void setNClob(String JavaDoc parameterName, Reader JavaDoc reader)
250             throws SQLException JavaDoc {
251         throw SQLExceptionFactory.notImplemented("setNClob(String,Reader)");
252     }
253
254     /**
255      * Returns <code>this</code> if this class implements the interface
256      *
257      * @param interfaces a Class defining an interface
258      * @return an object that implements the interface
259      * @throws java.sql.SQLExption if no object if found that implements the
260      * interface
261      */

262     public <T> T unwrap(java.lang.Class JavaDoc<T> interfaces)
263                                    throws SQLException JavaDoc {
264         try {
265             checkForClosedStatement();
266             return interfaces.cast(this);
267         } catch (ClassCastException JavaDoc cce) {
268             throw new SqlException(null, new ClientMessageId(SQLState.UNABLE_TO_UNWRAP),
269                     interfaces).getSQLException();
270         } catch (SqlException se) {
271             throw se.getSQLException();
272         }
273     }
274
275
276     /**
277      * Sets the designated parameter to the given input stream, which will have
278      * the specified number of bytes.
279      *
280      * @param parameterName the name of the first parameter
281      * @param x the java input stream which contains the ASCII parameter value
282      * @param length the number of bytes in the stream
283      * @exception SQLException thrown on failure.
284      *
285      */

286
287     public final void setAsciiStream(String JavaDoc parameterName, InputStream JavaDoc x, long length)
288     throws SQLException JavaDoc {
289         throw SQLExceptionFactory.notImplemented ("setAsciiStream(String,InputStream,long)");
290     }
291
292     /**
293      * Sets the designated parameter to the given input stream, which will have
294      * the specified number of bytes.
295      *
296      * @param parameterName the name of the first parameter
297      * @param x the java input stream which contains the binary parameter value
298      * @param length the number of bytes in the stream
299      * @exception SQLException thrown on failure.
300      *
301      */

302
303     public final void setBinaryStream(String JavaDoc parameterName, InputStream JavaDoc x, long length)
304     throws SQLException JavaDoc {
305         throw SQLExceptionFactory.notImplemented ("setBinaryStream(String,InputStream,long)");
306     }
307
308     /**
309      * Sets the designated parameter to the given Reader, which will have
310      * the specified number of bytes.
311      *
312      * @param parameterName the name of the first parameter
313      * @param x the java Reader which contains the UNICODE value
314      * @param length the number of bytes in the stream
315      * @exception SQLException thrown on failure.
316      *
317      */

318
319     public final void setCharacterStream(String JavaDoc parameterName, Reader JavaDoc x, long length)
320     throws SQLException JavaDoc {
321        throw SQLExceptionFactory.notImplemented ("setCharacterStream(String,Reader,long)");
322     }
323 }
324
Popular Tags