1 21 22 package org.apache.derby.client.net; 23 24 import org.apache.derby.client.am.ColumnMetaData; 25 import org.apache.derby.client.am.Section; 26 import org.apache.derby.client.am.SqlException; 27 import org.apache.derby.client.am.Statement; 28 import org.apache.derby.jdbc.ClientDriver; 29 30 public class NetStatement implements org.apache.derby.client.am.MaterialStatement { 31 32 Statement statement_; 33 34 35 NetConnection netConnection_; 37 38 NetAgent netAgent_; 40 41 42 public boolean qryrowsetSentOnOpnqry_ = false; 44 45 47 private NetStatement() { 48 initNetStatement(); 49 } 50 51 private void resetNetStatement() { 52 initNetStatement(); 53 } 54 55 private void initNetStatement() { 56 qryrowsetSentOnOpnqry_ = false; 57 } 58 59 NetStatement(org.apache.derby.client.am.Statement statement, NetAgent netAgent, NetConnection netConnection) { 61 this(); 62 initNetStatement(statement, netAgent, netConnection); 63 } 64 65 void resetNetStatement(org.apache.derby.client.am.Statement statement, NetAgent netAgent, NetConnection netConnection) { 66 resetNetStatement(); 67 initNetStatement(statement, netAgent, netConnection); 68 } 69 70 private void initNetStatement(org.apache.derby.client.am.Statement statement, NetAgent netAgent, NetConnection netConnection) { 71 netAgent_ = netAgent; 72 netConnection_ = netConnection; 73 statement_ = statement; 74 statement_.materialStatement_ = this; 75 } 76 77 NetStatement(NetAgent netAgent, NetConnection netConnection) throws SqlException { 79 this(ClientDriver.getFactory().newStatement(netAgent, netConnection), 80 netAgent, 81 netConnection); 82 } 83 84 void netReset(NetAgent netAgent, NetConnection netConnection) throws SqlException { 85 statement_.resetStatement(netAgent, netConnection); 86 resetNetStatement(statement_, netAgent, netConnection); 87 } 88 89 public void reset_() { 90 qryrowsetSentOnOpnqry_ = false; 91 } 92 93 NetStatement(NetAgent netAgent, NetConnection netConnection, int type, int concurrency, int holdability) throws SqlException { 95 this(ClientDriver.getFactory().newStatement(netAgent, netConnection, type, concurrency, holdability, java.sql.Statement.NO_GENERATED_KEYS, null), 96 netAgent, 97 netConnection); 98 } 99 100 void resetNetStatement(NetAgent netAgent, NetConnection netConnection, int type, int concurrency, int holdability) throws SqlException { 101 statement_.resetStatement(netAgent, netConnection, type, concurrency, holdability, java.sql.Statement.NO_GENERATED_KEYS, null); 102 resetNetStatement(statement_, netAgent, netConnection); 103 } 104 105 protected void finalize() throws java.lang.Throwable { 106 super.finalize(); 107 } 108 109 111 public void writeSetSpecialRegister_(java.util.ArrayList sqlsttList) throws SqlException { 112 netAgent_.statementRequest_.writeSetSpecialRegister(sqlsttList); 113 } 114 115 public void readSetSpecialRegister_() throws SqlException { 116 netAgent_.statementReply_.readSetSpecialRegister(statement_); 117 } 118 119 public void writeExecuteImmediate_(String sql, 120 Section section) throws SqlException { 121 netAgent_.statementRequest_.writeExecuteImmediate(this, sql, section); 122 } 123 124 public void readExecuteImmediate_() throws SqlException { 125 netAgent_.statementReply_.readExecuteImmediate(statement_); 126 } 127 128 public void readExecuteImmediateForBatch_(String sql) throws SqlException { 130 readExecuteImmediate_(); 131 } 132 133 public void writePrepareDescribeOutput_(String sql, 134 Section section) throws SqlException { 135 netAgent_.statementRequest_.writePrepareDescribeOutput(this, sql, section); 136 } 137 138 public void readPrepareDescribeOutput_() throws SqlException { 139 netAgent_.statementReply_.readPrepareDescribeOutput(statement_); 140 } 141 142 public void writeOpenQuery_(Section section, 143 int fetchSize, 144 int resultSetType) 145 throws SqlException { 146 netAgent_.statementRequest_.writeOpenQuery(this, 147 section, 148 fetchSize, 149 resultSetType); 150 } 151 152 public void readOpenQuery_() throws SqlException { 153 netAgent_.statementReply_.readOpenQuery(statement_); 154 } 155 156 public void writeExecuteCall_(boolean outputExpected, 157 String procedureName, 158 Section section, 159 int fetchSize, 160 boolean suppressResultSets, 161 int resultSetType, 162 ColumnMetaData parameterMetaData, 163 Object [] inputs) throws SqlException { 164 netAgent_.statementRequest_.writeExecuteCall(this, 165 outputExpected, 166 procedureName, 167 section, 168 fetchSize, 169 suppressResultSets, 170 resultSetType, 171 parameterMetaData, 172 inputs); 173 } 174 175 public void readExecuteCall_() throws SqlException { 176 netAgent_.statementReply_.readExecuteCall(statement_); 177 } 178 179 public void writePrepare_(String sql, Section section) throws SqlException { 180 netAgent_.statementRequest_.writePrepare(this, sql, section); 181 } 182 183 public void readPrepare_() throws SqlException { 184 netAgent_.statementReply_.readPrepare(statement_); 185 } 186 187 public void markClosedOnServer_() { 188 } 189 } 190 | Popular Tags |