001: /*
002:
003: Derby - Class org.apache.derby.client.net.NetCallableStatement
004:
005: Licensed to the Apache Software Foundation (ASF) under one or more
006: contributor license agreements. See the NOTICE file distributed with
007: this work for additional information regarding copyright ownership.
008: The ASF licenses this file to You under the Apache License, Version 2.0
009: (the "License"); you may not use this file except in compliance with
010: the License. You may obtain a copy of the License at
011:
012: http://www.apache.org/licenses/LICENSE-2.0
013:
014: Unless required by applicable law or agreed to in writing, software
015: distributed under the License is distributed on an "AS IS" BASIS,
016: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: See the License for the specific language governing permissions and
018: limitations under the License.
019:
020: */
021: package org.apache.derby.client.net;
022:
023: import org.apache.derby.client.am.CallableStatement;
024: import org.apache.derby.client.am.ColumnMetaData;
025: import org.apache.derby.client.am.MaterialPreparedStatement;
026: import org.apache.derby.client.am.Section;
027: import org.apache.derby.client.am.SqlException;
028: import org.apache.derby.jdbc.ClientDriver;
029: import org.apache.derby.client.am.ClientJDBCObjectFactory;
030: import org.apache.derby.client.ClientPooledConnection;
031:
032: public class NetCallableStatement extends NetPreparedStatement
033: implements MaterialPreparedStatement {
034:
035: CallableStatement callableStatement_;
036:
037: //-----------------------------state------------------------------------------
038:
039: //---------------------constructors/finalizer---------------------------------
040:
041: private void initNetCallableStatement() {
042: callableStatement_ = null;
043: }
044:
045: // Relay constructor for all NetCallableStatement constructors
046: NetCallableStatement(CallableStatement statement,
047: NetAgent netAgent, NetConnection netConnection)
048: throws SqlException {
049: super (statement, netAgent, netConnection);
050: initNetCallableStatement();
051: initNetCallableStatement(statement);
052: }
053:
054: void resetNetCallableStatement(CallableStatement statement,
055: NetAgent netAgent, NetConnection netConnection)
056: throws SqlException {
057: super .resetNetPreparedStatement(statement, netAgent,
058: netConnection);
059: initNetCallableStatement();
060: initNetCallableStatement(statement);
061: }
062:
063: private void initNetCallableStatement(CallableStatement statement)
064: throws SqlException {
065: callableStatement_ = statement;
066: callableStatement_.materialCallableStatement_ = this ;
067:
068: }
069:
070: // Called by abstract Connection.prepareCall().newCallableStatement()
071: // for jdbc 2 callable statements with scroll attributes.
072: NetCallableStatement(NetAgent netAgent,
073: NetConnection netConnection, String sql, int type,
074: int concurrency, int holdability, ClientPooledConnection cpc)
075: throws SqlException {
076: this (ClientDriver.getFactory()
077: .newCallableStatement(netAgent, netConnection, sql,
078: type, concurrency, holdability, cpc), netAgent,
079: netConnection);
080: }
081:
082: void resetNetCallableStatement(NetAgent netAgent,
083: NetConnection netConnection, String sql, int type,
084: int concurrency, int holdability) throws SqlException {
085: callableStatement_.resetCallableStatement(netAgent,
086: netConnection, sql, type, concurrency, holdability);
087: resetNetCallableStatement(callableStatement_, netAgent,
088: netConnection);
089: }
090:
091: void resetNetCallableStatement(NetAgent netAgent,
092: NetConnection netConnection, String sql, Section section)
093: throws SqlException {
094: callableStatement_.resetCallableStatement(netAgent,
095: netConnection, sql, section);
096: resetNetCallableStatement(callableStatement_, netAgent,
097: netConnection);
098: }
099:
100: void resetNetCallableStatement(NetAgent netAgent,
101: NetConnection netConnection, String sql, Section section,
102: ColumnMetaData parameterMetaData,
103: ColumnMetaData resultSetMetaData) throws SqlException {
104: callableStatement_.resetCallableStatement(netAgent,
105: netConnection, sql, section, parameterMetaData,
106: resultSetMetaData);
107: resetNetCallableStatement(callableStatement_, netAgent,
108: netConnection);
109: }
110:
111: protected void finalize() throws java.lang.Throwable {
112: super.finalize();
113: }
114:
115: }
|