1 29 30 package com.caucho.quercus.lib.db; 31 32 import com.caucho.quercus.env.Value; 33 import com.caucho.util.L10N; 34 35 import java.sql.CallableStatement ; 36 import java.util.HashMap ; 37 import java.util.logging.Logger ; 38 39 40 44 public class OracleStatement extends JdbcStatementResource { 45 private static final Logger log = Logger.getLogger(OracleStatement.class.getName()); 46 private static final L10N L = new L10N(OracleStatement.class); 47 48 private int _fetchedRows; 51 52 private HashMap <String ,Integer > _bindingVariables = new HashMap <String ,Integer >(); 54 private OracleOciLob _outParameter; 55 56 private Value _resultBuffer; 58 59 private HashMap <String ,Value> _byNameVariables = new HashMap <String ,Value>(); 78 79 84 OracleStatement(Oracle conn) 85 { 86 super(conn); 87 _fetchedRows = 0; 88 _outParameter = null; 89 } 90 91 97 public void putBindingVariable(String name, Integer value) 98 { 99 _bindingVariables.put(name, value); 100 } 101 102 108 public Integer getBindingVariable(String name) 109 { 110 return _bindingVariables.get(name); 111 } 112 113 119 public Integer removeBindingVariable(String name) 120 { 121 return _bindingVariables.remove(name); 122 } 123 124 129 public HashMap <String ,Integer > getBindingVariables() 130 { 131 return _bindingVariables; 132 } 133 134 137 public void resetBindingVariables() 138 { 139 _bindingVariables = new HashMap <String ,Integer >(); 140 } 141 142 145 public void setResultBuffer(Value resultBuffer) 146 { 147 _resultBuffer = resultBuffer; 148 } 149 150 155 public Value getResultBuffer() 156 { 157 return _resultBuffer; 158 } 159 160 166 public void putByNameVariable(String name, Value value) 167 { 168 _byNameVariables.put(name, value); 169 } 170 171 177 public Value getByNameVariable(String name) 178 { 179 return _byNameVariables.get(name); 180 } 181 182 188 public Value removeByNameVariable(String name) 189 { 190 return _byNameVariables.remove(name); 191 } 192 193 198 public HashMap <String ,Value> getByNameVariables() 199 { 200 return _byNameVariables; 201 } 202 203 206 public void resetByNameVariables() 207 { 208 _byNameVariables = new HashMap <String ,Value>(); 209 } 210 211 216 protected int increaseFetchedRows() { 217 return ++_fetchedRows; 218 } 219 220 223 protected CallableStatement getCallableStatement() 224 { 225 return (CallableStatement ) getPreparedStatement(); 226 } 227 228 233 protected int getFetchedRows() { 234 return _fetchedRows; 235 } 236 237 242 protected OracleOciLob getOutParameter() { 243 return _outParameter; 244 } 245 246 251 protected void setOutParameter(OracleOciLob outParameter) { 252 _outParameter = outParameter; 253 } 254 } 255 | Popular Tags |