1 19 20 package org.apache.derby.client.am; 21 22 public class Section { 23 24 protected int sectionNumber; 25 protected String packageName; 26 protected String serverCursorName; int resultSetHoldability_; 28 29 byte[] PKGNAMCBytes; 31 boolean isGenerated; 33 public Section(Agent agent, String name, int sectionNumber, String cursorName, int resultSetHoldability) { 34 init(agent, name, sectionNumber, cursorName, resultSetHoldability, false); 36 } 37 38 public Section(Agent agent, String name, int sectionNumber, String cursorName, int resultSetHoldability, boolean isGenerated) { 39 init(agent, name, sectionNumber, cursorName, resultSetHoldability, isGenerated); 40 } 41 42 private void init(Agent agent, String name, int sectionNumber, String cursorName, int resultSetHoldability, boolean isGenerated) { 43 this.packageName = name; 44 this.sectionNumber = sectionNumber; 45 this.serverCursorName = cursorName; 46 resultSetHoldability_ = resultSetHoldability; 47 agent_ = agent; 48 this.isGenerated = isGenerated; 49 50 if (!isGenerated) { 58 if (resultSetHoldability_ == ResultSet.HOLD_CURSORS_OVER_COMMIT) { 59 PKGNAMCBytes = agent_.sectionManager_.holdPKGNAMCBytes; 60 } else if (resultSetHoldability_ == ResultSet.CLOSE_CURSORS_AT_COMMIT) { 61 PKGNAMCBytes = agent_.sectionManager_.noHoldPKGNAMCBytes; 62 } 63 } 64 } 65 66 71 public void setPKGNAMCBytes(byte[] b) { 72 if (isGenerated) { 73 PKGNAMCBytes = b; 74 } else { 75 agent_.sectionManager_.setPKGNAMCBytes(b, resultSetHoldability_); 76 } 77 } 78 79 82 public byte[] getPKGNAMCBytes() { 83 return PKGNAMCBytes; 84 } 85 86 public String getPackageName() { 87 return this.packageName; 88 } 89 90 91 93 public int getSectionNumber() { 94 return this.sectionNumber; 95 } 96 97 public String getPackage() { 98 return this.packageName; 99 } 100 101 public String getServerCursorName() { 102 return this.serverCursorName; 103 } 104 105 107 public String serverCursorNameForPositionedUpdate_ = null; transient protected String clientCursorName_; 110 public String getServerCursorNameForPositionedUpdate() { 111 return serverCursorNameForPositionedUpdate_; 112 } 113 114 public String getClientCursorName() { 115 return clientCursorName_; 116 } 117 118 public void setClientCursorName(String clientCursorName) { this.clientCursorName_ = clientCursorName; 121 } 122 123 protected Agent agent_; 124 125 126 public void free() { 127 if (resultSetHoldability_ != -1) { 128 this.agent_.sectionManager_.freeSection(this, resultSetHoldability_); 129 } 130 } 131 132 public boolean isReservedPositionedUpdate() { 133 return false; 134 } 135 136 public int getStaticStatementType() { 137 return 0; 138 } 139 140 public Section getPositionedUpdateSection() throws SqlException { 141 return agent_.sectionManager_.getPositionedUpdateSection(this); 142 } 143 144 public void setCursorName(String name) { 145 serverCursorName = name; 146 } 147 148 } 149 150 | Popular Tags |