1 21 22 package org.apache.derby.iapi.jdbc; 23 24 import java.io.InputStream ; 25 import java.io.Reader ; 26 import java.util.Calendar ; 27 28 import java.sql.*; 29 import java.net.URL ; 30 31 35 public class BrokeredPreparedStatement extends BrokeredStatement 36 implements EnginePreparedStatement 37 { 38 39 42 final String sql; 43 44 public BrokeredPreparedStatement(BrokeredStatementControl control, int jdbcLevel, String sql) throws SQLException 45 { 46 super(control, jdbcLevel); 47 this.sql = sql; 48 } 49 50 60 public EngineParameterMetaData getEmbedParameterSetMetaData() 61 throws SQLException 62 { 63 return ((EnginePreparedStatement)getPreparedStatement()).getEmbedParameterSetMetaData(); 64 } 65 72 public final ResultSet executeQuery() throws SQLException 73 { 74 return wrapResultSet(getPreparedStatement().executeQuery()); 75 } 76 77 86 public final int executeUpdate() throws SQLException 87 { 88 return getPreparedStatement().executeUpdate(); 89 } 90 91 100 public final void setNull(int parameterIndex, int sqlType) throws SQLException 101 { 102 getPreparedStatement().setNull( parameterIndex, sqlType); 103 } 104 105 114 public final void setNull(int parameterIndex, int sqlType, String typeName) throws SQLException 115 { 116 getPreparedStatement().setNull( parameterIndex, sqlType, typeName); 117 } 118 119 129 public final void setBoolean(int parameterIndex, boolean x) throws SQLException 130 { 131 getPreparedStatement().setBoolean( parameterIndex, x); 132 } 133 134 142 public final void setByte(int parameterIndex, byte x) throws SQLException 143 { 144 getPreparedStatement().setByte( parameterIndex, x); 145 } 146 147 155 public final void setShort(int parameterIndex, short x) throws SQLException 156 { 157 getPreparedStatement().setShort( parameterIndex, x); 158 } 159 160 168 public final void setInt(int parameterIndex, int x) throws SQLException 169 { 170 getPreparedStatement().setInt( parameterIndex, x); 171 } 172 173 181 public final void setLong(int parameterIndex, long x) throws SQLException 182 { 183 getPreparedStatement().setLong( parameterIndex, x); 184 } 185 186 194 public final void setFloat(int parameterIndex, float x) throws SQLException 195 { 196 getPreparedStatement().setFloat( parameterIndex, x); 197 } 198 199 207 public final void setDouble(int parameterIndex, double x) throws SQLException 208 { 209 getPreparedStatement().setDouble( parameterIndex, x); 210 } 211 212 213 222 public final void setBigDecimal(int parameterIndex, java.math.BigDecimal x) throws SQLException 223 { 224 getPreparedStatement().setBigDecimal( parameterIndex, x); 225 } 226 227 237 public final void setString(int parameterIndex, String x) throws SQLException 238 { 239 getPreparedStatement().setString( parameterIndex, x); 240 } 241 242 252 public final void setBytes(int parameterIndex, byte[] x) throws SQLException 253 { 254 getPreparedStatement().setBytes( parameterIndex, x); 255 } 256 257 265 public final void setDate(int parameterIndex, Date x) throws SQLException 266 { 267 getPreparedStatement().setDate( parameterIndex, x); 268 } 269 270 278 public final void setTime(int parameterIndex, Time x) throws SQLException 279 { 280 getPreparedStatement().setTime( parameterIndex, x); 281 } 282 283 292 public final void setTimestamp(int parameterIndex, Timestamp x) throws SQLException 293 { 294 getPreparedStatement().setTimestamp( parameterIndex, x); 295 } 296 297 306 public final void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException 307 { 308 getPreparedStatement().setAsciiStream( parameterIndex, x, length); 309 } 310 311 322 public final void setUnicodeStream(int parameterIndex, InputStream x, int length) throws SQLException 323 { 324 getPreparedStatement().setUnicodeStream( parameterIndex, x, length); 325 } 326 327 333 public final void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException 334 { 335 getPreparedStatement().setBinaryStream( parameterIndex, x, length); 336 } 337 338 345 public final void addBatch() throws SQLException 346 { 347 getPreparedStatement().addBatch( ); 348 } 349 350 358 public final void clearParameters() throws SQLException 359 { 360 getPreparedStatement().clearParameters( ); 361 } 362 363 372 public final java.sql.ResultSetMetaData getMetaData() throws SQLException 373 { 374 return getPreparedStatement().getMetaData(); 375 } 376 377 396 public final void setObject(int parameterIndex, Object x, int targetSqlType, int scale) 397 throws SQLException 398 { 399 getPreparedStatement().setObject( parameterIndex, x, targetSqlType, scale); 400 } 401 402 406 public final void setObject(int parameterIndex, Object x, int targetSqlType) 407 throws SQLException 408 { 409 getPreparedStatement().setObject( parameterIndex, x, targetSqlType); 410 } 411 412 429 public final void setObject(int parameterIndex, Object x) 430 throws SQLException 431 { 432 getPreparedStatement().setObject( parameterIndex, x); 433 } 434 435 439 public final boolean execute() throws SQLException 440 { 441 return getPreparedStatement().execute(); 442 } 443 444 public final void setCharacterStream(int parameterIndex, 445 Reader reader, 446 int length) 447 throws SQLException 448 { 449 getPreparedStatement().setCharacterStream( parameterIndex, reader, length); 450 } 451 452 public final void setRef(int i, 453 Ref x) 454 throws SQLException 455 { 456 getPreparedStatement().setRef( i, x); 457 } 458 459 public final void setBlob(int i, 460 Blob x) 461 throws SQLException 462 { 463 getPreparedStatement().setBlob( i, x); 464 } 465 466 public final void setClob(int i, 467 Clob x) 468 throws SQLException 469 { 470 getPreparedStatement().setClob( i, x); 471 } 472 473 public final void setArray(int i, 474 Array x) 475 throws SQLException 476 { 477 getPreparedStatement().setArray( i, x); 478 } 479 480 public final void setDate(int i, 481 Date x, 482 Calendar cal) 483 throws SQLException 484 { 485 getPreparedStatement().setDate( i, x, cal); 486 } 487 488 public final void setTime(int i, 489 Time x, 490 Calendar cal) 491 throws SQLException 492 { 493 getPreparedStatement().setTime( i, x, cal); 494 } 495 496 public final void setTimestamp(int i, 497 Timestamp x, 498 Calendar cal) 499 throws SQLException 500 { 501 getPreparedStatement().setTimestamp( i, x, cal); 502 } 503 504 507 508 515 PreparedStatement getPreparedStatement() throws SQLException { 516 return control.getRealPreparedStatement(); 517 } 518 519 522 public final Statement getStatement() throws SQLException { 523 return getPreparedStatement(); 524 } 525 526 529 public PreparedStatement createDuplicateStatement(Connection conn, PreparedStatement oldStatement) throws SQLException { 530 531 PreparedStatement newStatement = conn.prepareStatement(sql, resultSetType, resultSetConcurrency); 532 533 setStatementState(oldStatement, newStatement); 534 535 return newStatement; 536 } 537 } 538 | Popular Tags |