KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > impl > jdbc > EmbedPreparedStatement40


1 /*
2  
3    Derby - Class org.apache.derby.impl.jdbc.EmbedPreparedStatement40
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.impl.jdbc;
23
24 import java.io.InputStream JavaDoc;
25 import java.io.Reader JavaDoc;
26 import java.sql.RowId JavaDoc;
27 import java.sql.NClob JavaDoc;
28 import java.sql.ParameterMetaData JavaDoc;
29 import java.sql.SQLException JavaDoc;
30 import java.sql.SQLXML JavaDoc;
31 import java.sql.Types JavaDoc;
32 import org.apache.derby.iapi.reference.SQLState;
33 import org.apache.derby.iapi.error.StandardException;
34
35 public class EmbedPreparedStatement40 extends EmbedPreparedStatement30 {
36     
37     public EmbedPreparedStatement40(EmbedConnection conn, String JavaDoc sql, boolean forMetaData,
38         int resultSetType, int resultSetConcurrency, int resultSetHoldability,
39         int autoGeneratedKeys, int[] columnIndexes, String JavaDoc[] columnNames) throws SQLException JavaDoc {
40         super(conn, sql, forMetaData, resultSetType, resultSetConcurrency, resultSetHoldability,
41             autoGeneratedKeys, columnIndexes, columnNames);
42     }
43     
44     public void setRowId(int parameterIndex, RowId JavaDoc x) throws SQLException JavaDoc{
45         throw Util.notImplemented();
46     }
47     
48     public void setNString(int index, String JavaDoc value) throws SQLException JavaDoc{
49         throw Util.notImplemented();
50     }
51
52     public void setNCharacterStream(int parameterIndex, Reader JavaDoc value)
53             throws SQLException JavaDoc {
54         throw Util.notImplemented();
55     }
56
57     public void setNCharacterStream(int index, Reader JavaDoc value, long length) throws SQLException JavaDoc{
58         throw Util.notImplemented();
59     }
60
61     public void setNClob(int parameterIndex, Reader JavaDoc reader)
62             throws SQLException JavaDoc {
63         throw Util.notImplemented();
64     }
65
66     public void setNClob(int index, NClob JavaDoc value) throws SQLException JavaDoc{
67         throw Util.notImplemented();
68     }
69
70     public void setNClob(int parameterIndex, Reader JavaDoc reader, long length)
71     throws SQLException JavaDoc{
72         throw Util.notImplemented();
73     }
74     
75     public void setSQLXML(int parameterIndex, SQLXML JavaDoc xmlObject) throws SQLException JavaDoc{
76         throw Util.notImplemented();
77     }
78     
79    /**
80     * JDBC 4.0
81     *
82     * Retrieves the number, types and properties of this PreparedStatement
83     * object's parameters.
84     *
85     * @return a ParameterMetaData object that contains information about the
86     * number, types and properties of this PreparedStatement object's parameters.
87     * @exception SQLException if a database access error occurs
88     *
89     */

90     public ParameterMetaData JavaDoc getParameterMetaData()
91         throws SQLException JavaDoc
92     {
93       checkStatus();
94       return new EmbedParameterMetaData40(
95                 getParms(), preparedStatement.getParameterTypes());
96     }
97     
98     /**
99      * Returns false unless <code>interfaces</code> is implemented
100      *
101      * @param interfaces a Class defining an interface.
102      * @return true if this implements the interface or
103      * directly or indirectly wraps an object
104      * that does.
105      * @throws java.sql.SQLException if an error occurs while determining
106      * whether this is a wrapper for an object
107      * with the given interface.
108      */

109     public boolean isWrapperFor(Class JavaDoc<?> interfaces) throws SQLException JavaDoc {
110         checkStatus();
111         return interfaces.isInstance(this);
112     }
113     
114     /**
115      * Returns <code>this</code> if this class implements the interface
116      *
117      * @param interfaces a Class defining an interface
118      * @return an object that implements the interface
119      * @throws java.sql.SQLExption if no object if found that implements the
120      * interface
121      */

122     public <T> T unwrap(java.lang.Class JavaDoc<T> interfaces)
123                             throws SQLException JavaDoc{
124         checkStatus();
125         try {
126             return interfaces.cast(this);
127         } catch (ClassCastException JavaDoc cce) {
128             throw newSQLException(SQLState.UNABLE_TO_UNWRAP,interfaces);
129         }
130     }
131 }
132
133
Popular Tags