KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2
3    Derby - Class org.apache.derby.client.am.Statement40
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.sql.SQLException JavaDoc;
25 import org.apache.derby.shared.common.reference.SQLState;
26
27 /**
28  * Implements JDBC 4.0 specific methods
29  */

30
31 public class Statement40 extends Statement{
32     /**
33      * Calls the super class constructor to pass the parameters
34      * @param agent Agent
35      * @param connection Connection
36      * @throws SqlException
37      *
38      */

39     public Statement40(Agent agent, Connection connection) throws SqlException {
40         super(agent,connection);
41     }
42     
43     /**
44      * Calls the superclass constructor to pass the arguments
45      * @param agent Agent
46      * @param connection Connection
47      * @param type int
48      * @param concurrency int
49      * @param holdability int
50      * @param autoGeneratedKeys int
51      * @param columnNames String[]
52      * @throws SqlException
53      *
54      */

55     public Statement40(Agent agent, Connection connection, int type,
56                      int concurrency, int holdability,
57                      int autoGeneratedKeys, String JavaDoc[] columnNames)
58                      throws SqlException {
59         super(agent,connection,type,concurrency,holdability,autoGeneratedKeys,
60                 columnNames);
61     }
62     
63     /**
64      * Returns <code>this</code> if this class implements the interface
65      *
66      * @param interfaces a Class defining an interface
67      * @return an object that implements the interface
68      * @throws java.sql.SQLExption if no object if found that implements the
69      * interface
70      */

71     public <T> T unwrap(java.lang.Class JavaDoc<T> interfaces)
72                                    throws SQLException JavaDoc {
73         try {
74             checkForClosedStatement();
75             return interfaces.cast(this);
76         } catch (ClassCastException JavaDoc cce) {
77             throw new SqlException(null,new ClientMessageId(SQLState.UNABLE_TO_UNWRAP),
78                     interfaces).getSQLException();
79         } catch (SqlException se) {
80             throw se.getSQLException();
81         }
82     }
83 }
84
Popular Tags