1 4 5 package org.smartlib.pool.core; 6 7 8 import java.sql.*; 9 import java.sql.Date ; 10 import java.util.*; 11 import java.math.*; 12 import java.io.InputStream ; 13 import java.io.Reader ; 14 import java.net.URL ; 15 16 23 24 25 public class SmartCallableStatement extends SmartPreparedStatement 26 implements Close , CallableStatement { 27 28 private CallableStatement cstmt; 29 private SmartConnection sConn; 30 private boolean isClosed = false; 31 Debugger debug = 32 new Debugger("org.smartlib.pool.core.SmartCallableStatement", true); 33 34 SmartCallableStatement(CallableStatement cstmt 35 , SmartConnection sConn) { 36 37 super(cstmt,sConn); 38 this.cstmt = cstmt; 39 this.sConn = sConn; 40 41 } 42 43 private void preProcess() throws SQLException { 44 45 if (isClosed()) 46 throw new SQLException("Prepared Statement already closed"); 47 sConn.setLastAccessedTime(); 48 49 } 50 51 public void registerOutParameter(int p0, int p1) throws SQLException { 52 53 preProcess(); 54 cstmt.registerOutParameter(p0,p1); 55 56 } 57 58 public void registerOutParameter(int p0, int p1, int p2) 59 throws SQLException { 60 61 preProcess(); 62 cstmt.registerOutParameter(p0,p1,p2); 63 64 } 65 66 public boolean wasNull() throws SQLException { 67 68 preProcess(); 69 return cstmt.wasNull(); 70 71 } 72 73 public String getString(int p0) throws SQLException { 74 75 preProcess(); 76 return cstmt.getString(p0); 77 78 } 79 80 public boolean getBoolean(int p0) throws SQLException { 81 82 preProcess(); 83 return cstmt.getBoolean(p0); 84 85 } 86 87 public byte getByte(int p0) throws SQLException { 88 89 preProcess(); 90 return cstmt.getByte(p0); 91 92 } 93 94 public short getShort(int p0) throws SQLException { 95 96 preProcess(); 97 return cstmt.getShort(p0); 98 99 } 100 101 public int getInt(int p0) throws SQLException { 102 103 preProcess(); 104 return cstmt.getInt(p0); 105 106 } 107 108 public long getLong(int p0) throws SQLException { 109 110 preProcess(); 111 return cstmt.getLong(p0); 112 113 } 114 115 public float getFloat(int p0) throws SQLException { 116 117 preProcess(); 118 return cstmt.getFloat(p0); 119 120 } 121 122 public double getDouble(int p0) throws SQLException { 123 124 preProcess(); 125 return getDouble(p0); 126 127 } 128 129 public BigDecimal getBigDecimal(int p0, int p1) throws SQLException { 130 131 preProcess(); 132 return getBigDecimal(p0,p1); 133 134 } 135 136 public byte[] getBytes(int p0) throws SQLException { 137 138 preProcess(); 139 return getBytes(p0); 140 141 } 142 143 public java.sql.Date getDate(int p0) throws SQLException { 144 145 preProcess(); 146 return cstmt.getDate(p0); 147 148 } 149 150 public Time getTime(int p0) throws SQLException { 151 152 preProcess(); 153 return cstmt.getTime(p0); 154 155 } 156 157 public Timestamp getTimestamp(int p0) throws SQLException { 158 159 preProcess(); 160 return cstmt.getTimestamp(p0); 161 162 } 163 164 public Object getObject(int p0) throws SQLException { 165 166 preProcess(); 167 return cstmt.getObject(p0); 168 169 } 170 171 public BigDecimal getBigDecimal(int p0) throws SQLException { 172 173 preProcess(); 174 return cstmt.getBigDecimal(p0); 175 176 } 177 178 public Object getObject(int i, Map<String , Class <?>> map) throws SQLException { 179 return null; } 181 182 183 public Ref getRef(int p0) throws SQLException { 184 185 preProcess(); 186 return cstmt.getRef(p0); 187 188 } 189 190 public Blob getBlob(int p0) throws SQLException { 191 192 preProcess(); 193 return cstmt.getBlob(p0); 194 195 } 196 197 public Clob getClob(int p0) throws SQLException { 198 199 preProcess(); 200 return cstmt.getClob(p0); 201 202 } 203 204 public Array getArray(int p0) throws SQLException { 205 206 preProcess(); 207 return cstmt.getArray(p0); 208 209 } 210 211 public java.sql.Date getDate(int p0, Calendar p1) throws SQLException { 212 213 preProcess(); 214 return cstmt.getDate(p0,p1); 215 216 } 217 218 public Time getTime(int p0, Calendar p1) throws SQLException { 219 220 preProcess(); 221 return cstmt.getTime(p0,p1); 222 223 } 224 225 public Timestamp getTimestamp(int p0, Calendar p1) throws SQLException { 226 227 preProcess(); 228 return cstmt.getTimestamp(p0,p1); 229 230 } 231 232 public void registerOutParameter(int p0, int p1, String p2) 233 throws SQLException { 234 235 preProcess(); 236 cstmt.registerOutParameter(p0,p1,p2); 237 238 } 239 240 public void registerOutParameter(String parameterName, int sqlType) throws SQLException { 241 } 243 244 public void registerOutParameter(String parameterName, int sqlType, int scale) throws SQLException { 245 } 247 248 public void registerOutParameter(String parameterName, int sqlType, String typeName) throws SQLException { 249 } 251 252 public URL getURL(int parameterIndex) throws SQLException { 253 return null; } 255 256 public void setURL(String parameterName, URL val) throws SQLException { 257 } 259 260 public void setNull(String parameterName, int sqlType) throws SQLException { 261 } 263 264 public void setBoolean(String parameterName, boolean x) throws SQLException { 265 } 267 268 public void setByte(String parameterName, byte x) throws SQLException { 269 } 271 272 public void setShort(String parameterName, short x) throws SQLException { 273 } 275 276 public void setInt(String parameterName, int x) throws SQLException { 277 } 279 280 public void setLong(String parameterName, long x) throws SQLException { 281 } 283 284 public void setFloat(String parameterName, float x) throws SQLException { 285 } 287 288 public void setDouble(String parameterName, double x) throws SQLException { 289 } 291 292 public void setBigDecimal(String parameterName, BigDecimal x) throws SQLException { 293 } 295 296 public void setString(String parameterName, String x) throws SQLException { 297 } 299 300 public void setBytes(String parameterName, byte x[]) throws SQLException { 301 } 303 304 public void setDate(String parameterName, Date x) throws SQLException { 305 } 307 308 public void setTime(String parameterName, Time x) throws SQLException { 309 } 311 312 public void setTimestamp(String parameterName, Timestamp x) throws SQLException { 313 } 315 316 public void setAsciiStream(String parameterName, InputStream x, int length) throws SQLException { 317 } 319 320 public void setBinaryStream(String parameterName, InputStream x, int length) throws SQLException { 321 } 323 324 public void setObject(String parameterName, Object x, int targetSqlType, int scale) throws SQLException { 325 } 327 328 public void setObject(String parameterName, Object x, int targetSqlType) throws SQLException { 329 } 331 332 public void setObject(String parameterName, Object x) throws SQLException { 333 } 335 336 public void setCharacterStream(String parameterName, Reader reader, int length) throws SQLException { 337 } 339 340 public void setDate(String parameterName, Date x, Calendar cal) throws SQLException { 341 } 343 344 public void setTime(String parameterName, Time x, Calendar cal) throws SQLException { 345 } 347 348 public void setTimestamp(String parameterName, Timestamp x, Calendar cal) throws SQLException { 349 } 351 352 public void setNull(String parameterName, int sqlType, String typeName) throws SQLException { 353 } 355 356 public String getString(String parameterName) throws SQLException { 357 return null; } 359 360 public boolean getBoolean(String parameterName) throws SQLException { 361 return false; } 363 364 public byte getByte(String parameterName) throws SQLException { 365 return 0; } 367 368 public short getShort(String parameterName) throws SQLException { 369 return 0; } 371 372 public int getInt(String parameterName) throws SQLException { 373 return 0; } 375 376 public long getLong(String parameterName) throws SQLException { 377 return 0; } 379 380 public float getFloat(String parameterName) throws SQLException { 381 return 0; } 383 384 public double getDouble(String parameterName) throws SQLException { 385 return 0; } 387 388 public byte[] getBytes(String parameterName) throws SQLException { 389 return new byte[0]; } 391 392 public Date getDate(String parameterName) throws SQLException { 393 return null; } 395 396 public Time getTime(String parameterName) throws SQLException { 397 return null; } 399 400 public Timestamp getTimestamp(String parameterName) throws SQLException { 401 return null; } 403 404 public Object getObject(String parameterName) throws SQLException { 405 return null; } 407 408 public BigDecimal getBigDecimal(String parameterName) throws SQLException { 409 return null; } 411 412 public Object getObject(String parameterName, Map<String , Class <?>> map) throws SQLException { 413 return null; } 415 416 public Ref getRef(String parameterName) throws SQLException { 417 return null; } 419 420 public Blob getBlob(String parameterName) throws SQLException { 421 return null; } 423 424 public Clob getClob(String parameterName) throws SQLException { 425 return null; } 427 428 public Array getArray(String parameterName) throws SQLException { 429 return null; } 431 432 public Date getDate(String parameterName, Calendar cal) throws SQLException { 433 return null; } 435 436 public Time getTime(String parameterName, Calendar cal) throws SQLException { 437 return null; } 439 440 public Timestamp getTimestamp(String parameterName, Calendar cal) throws SQLException { 441 return null; } 443 444 public URL getURL(String parameterName) throws SQLException { 445 return null; } 447 448 public boolean isClosed() { 449 450 return isClosed; 451 452 } 453 454 public String toString() { 455 456 return cstmt.toString(); 457 458 } 459 460 public void close() throws SQLException { 461 462 if (isClosed) 463 throw new SQLException("CallableStatement already closed"); 464 cstmt.close(); 465 debug.print("CallableStatement Closed for:" + sConn.getOwner()); 466 isClosed=true; 467 468 } 469 470 471 } 472 | Popular Tags |