Code Search for Developers
 
 
  

NetPreparedStatement.java from CSDerby at Krugle


Show NetPreparedStatement.java syntax highlighted

/*

   Derby - Class org.apache.derby.client.net.NetPreparedStatement

   Copyright (c) 2001, 2005 The Apache Software Foundation or its licensors, where applicable.

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

*/
package org.apache.derby.client.net;

import org.apache.derby.client.am.ColumnMetaData;
import org.apache.derby.client.am.PreparedStatement;
import org.apache.derby.client.am.Section;
import org.apache.derby.client.am.SqlException;


public class NetPreparedStatement extends NetStatement
        implements org.apache.derby.client.am.MaterialPreparedStatement {

    // Alias for (NetPreparedStatement) super.statement.
    /*final*/
    org.apache.derby.client.am.PreparedStatement preparedStatement_;


    // Relay constructor for NetCallableStatement.
    NetPreparedStatement(org.apache.derby.client.am.PreparedStatement statement,
                         NetAgent netAgent,
                         NetConnection netConnection) {
        super(statement, netAgent, netConnection);
        initNetPreparedStatement(statement);
    }

    void resetNetPreparedStatement(org.apache.derby.client.am.PreparedStatement statement,
                                   NetAgent netAgent,
                                   NetConnection netConnection) {
        super.resetNetStatement(statement, netAgent, netConnection);
        initNetPreparedStatement(statement);
    }

    private void initNetPreparedStatement(org.apache.derby.client.am.PreparedStatement statement) {
        preparedStatement_ = statement;
        preparedStatement_.materialPreparedStatement_ = this;
    }

    // Called by abstract Connection.prepareStatment().newPreparedStatement() for jdbc 2 prepared statements
    // with scroll attributes.
    NetPreparedStatement(NetAgent netAgent, NetConnection netConnection, String sql, int type, int concurrency, int holdability, int autoGeneratedKeys, String[] columnNames) throws SqlException {
        this(new PreparedStatement(netAgent, netConnection, sql, type, concurrency, holdability, autoGeneratedKeys, columnNames),
                netAgent,
                netConnection);
    }

    void resetNetPreparedStatement(NetAgent netAgent, NetConnection netConnection, String sql, int type, int concurrency, int holdability, int autoGeneratedKeys, String[] columnNames) throws SqlException {
        preparedStatement_.resetPreparedStatement(netAgent, netConnection, sql, type, concurrency, holdability, autoGeneratedKeys, columnNames);
        resetNetPreparedStatement(preparedStatement_, netAgent, netConnection);
    }

    // For JDBC 3.0 positioned updates.
    NetPreparedStatement(NetAgent netAgent,
                         NetConnection netConnection,
                         String sql,
                         Section section) throws SqlException {
        this(new PreparedStatement(netAgent, netConnection, sql, section),
                netAgent,
                netConnection);
    }

    void resetNetPreparedStatement(NetAgent netAgent,
                                   NetConnection netConnection,
                                   String sql,
                                   Section section) throws SqlException {
        preparedStatement_.resetPreparedStatement(netAgent, netConnection, sql, section);
        resetNetPreparedStatement(preparedStatement_, netAgent, netConnection);
    }

    void resetNetPreparedStatement(NetAgent netAgent,
                                   NetConnection netConnection,
                                   String sql,
                                   Section section,
                                   ColumnMetaData parameterMetaData,
                                   ColumnMetaData resultSetMetaData) throws SqlException {
        preparedStatement_.resetPreparedStatement(netAgent, netConnection, sql, section, parameterMetaData, resultSetMetaData);
        this.resetNetPreparedStatement(preparedStatement_, netAgent, netConnection);
    }

    protected void finalize() throws java.lang.Throwable {
        super.finalize();
    }

    public void writeExecute_(Section section,
                              ColumnMetaData parameterMetaData,
                              Object[] inputs,
                              int numInputColumns,
                              boolean outputExpected,
                              // This is a hint to the material layer that more write commands will follow.
                              // It is ignored by the driver in all cases except when blob data is written,
                              // in which case this boolean is used to optimize the implementation.
                              // Otherwise we wouldn't be able to chain after blob data is sent.
                              // If we could always chain a no-op DDM after every execute that writes blobs
                              // then we could just always set the chaining flag to on for blob send data
                              boolean chainedWritesFollowingSetLob) throws SqlException {
        netAgent_.statementRequest_.writeExecute(this,
                section,
                parameterMetaData,
                inputs,
                numInputColumns,
                outputExpected,
                chainedWritesFollowingSetLob);
    }


    public void readExecute_() throws SqlException {
        netAgent_.statementReply_.readExecute(preparedStatement_);
    }

    public void writeOpenQuery_(Section section,
                                int fetchSize,
                                int resultSetType,
                                int numInputColumns,
                                ColumnMetaData parameterMetaData,
                                Object[] inputs) throws SqlException {
        netAgent_.statementRequest_.writeOpenQuery(this,
                section,
                fetchSize,
                resultSetType,
                numInputColumns,
                parameterMetaData,
                inputs);
    }
    // super.readOpenQuery()

    public void writeDescribeInput_(Section section) throws SqlException {
        netAgent_.statementRequest_.writeDescribeInput(this, section);
    }

    public void readDescribeInput_() throws SqlException {
        netAgent_.statementReply_.readDescribeInput(preparedStatement_);
    }

    public void writeDescribeOutput_(Section section) throws SqlException {
        netAgent_.statementRequest_.writeDescribeOutput(this, section);
    }

    public void readDescribeOutput_() throws SqlException {
        netAgent_.statementReply_.readDescribeOutput(preparedStatement_);
    }
}




See more files for this project here

CSDerby

CSDerby is not CloudScape-Derby(for Java) but rather Derby forked/ported to CSharp. Specifically it is intended to be a native c# Embedded DB for the mono/net platform with the ADO.NET API instead of the JDBC API.

Project homepage: http://sourceforge.net/projects/csharpderbyport
Programming language(s): Java,SQL
License: apache20

  CcsidManager.java
  CodePoint.java
  CodePointNameTable.java
  ConnectionReply.java
  ConnectionReplyInterface.java
  ConnectionRequestInterface.java
  DssConstants.java
  EbcdicCcsidManager.java
  FdocaConstants.java
  FdocaSimpleDataArray.java
  NetAgent.java
  NetCallableStatement.java
  NetConfiguration.java
  NetConnection.java
  NetConnectionReply.java
  NetConnectionRequest.java
  NetCursor.java
  NetDatabaseMetaData.java
  NetIndoubtTransaction.java
  NetLogWriter.java
  NetPackageReply.java
  NetPackageRequest.java
  NetPreparedStatement.java
  NetResultSet.java
  NetResultSetReply.java
  NetResultSetRequest.java
  NetSqlca.java
  NetSqldta.java
  NetStatement.java
  NetStatementReply.java
  NetStatementRequest.java
  NetXACallInfo.java
  NetXAConnection.java
  NetXAConnectionReply.java
  NetXAConnectionRequest.java
  NetXAResource.java
  OpenSocketAction.java
  Reply.java
  Request.java
  ResultSetReply.java
  ResultSetReplyInterface.java
  ResultSetRequestInterface.java
  StatementReply.java
  StatementReplyInterface.java
  StatementRequestInterface.java
  Typdef.java