001package io.ebean.datasource.delegate; 002 003import java.io.InputStream; 004import java.io.Reader; 005import java.math.BigDecimal; 006import java.net.URL; 007import java.sql.*; 008import java.util.Calendar; 009 010public class PreparedStatementDelegator implements PreparedStatement { 011 012 protected final PreparedStatement delegate; 013 014 public PreparedStatementDelegator(PreparedStatement delegate) { 015 this.delegate = delegate; 016 } 017 018 @Override 019 public void closeOnCompletion() throws SQLException { 020 delegate.closeOnCompletion(); 021 } 022 023 @Override 024 public boolean isCloseOnCompletion() throws SQLException { 025 return delegate.isCloseOnCompletion(); 026 } 027 028 public ResultSet executeQuery() throws SQLException { 029 return delegate.executeQuery(); 030 } 031 032 public int executeUpdate() throws SQLException { 033 return delegate.executeUpdate(); 034 } 035 036 public void setNull(int parameterIndex, int sqlType) throws SQLException { 037 delegate.setNull(parameterIndex, sqlType); 038 } 039 040 public void setBoolean(int parameterIndex, boolean x) throws SQLException { 041 delegate.setBoolean(parameterIndex, x); 042 } 043 044 public void setByte(int parameterIndex, byte x) throws SQLException { 045 delegate.setByte(parameterIndex, x); 046 } 047 048 public void setShort(int parameterIndex, short x) throws SQLException { 049 delegate.setShort(parameterIndex, x); 050 } 051 052 public void setInt(int parameterIndex, int x) throws SQLException { 053 delegate.setInt(parameterIndex, x); 054 } 055 056 public void setLong(int parameterIndex, long x) throws SQLException { 057 delegate.setLong(parameterIndex, x); 058 } 059 060 public void setFloat(int parameterIndex, float x) throws SQLException { 061 delegate.setFloat(parameterIndex, x); 062 } 063 064 public void setDouble(int parameterIndex, double x) throws SQLException { 065 delegate.setDouble(parameterIndex, x); 066 } 067 068 public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException { 069 delegate.setBigDecimal(parameterIndex, x); 070 } 071 072 public void setString(int parameterIndex, String x) throws SQLException { 073 delegate.setString(parameterIndex, x); 074 } 075 076 public void setBytes(int parameterIndex, byte[] x) throws SQLException { 077 delegate.setBytes(parameterIndex, x); 078 } 079 080 public void setDate(int parameterIndex, Date x) throws SQLException { 081 delegate.setDate(parameterIndex, x); 082 } 083 084 public void setTime(int parameterIndex, Time x) throws SQLException { 085 delegate.setTime(parameterIndex, x); 086 } 087 088 public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException { 089 delegate.setTimestamp(parameterIndex, x); 090 } 091 092 public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException { 093 delegate.setAsciiStream(parameterIndex, x, length); 094 } 095 096 @SuppressWarnings("deprecation") 097 public void setUnicodeStream(int parameterIndex, InputStream x, int length) throws SQLException { 098 delegate.setUnicodeStream(parameterIndex, x, length); 099 } 100 101 public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException { 102 delegate.setBinaryStream(parameterIndex, x, length); 103 } 104 105 public void clearParameters() throws SQLException { 106 delegate.clearParameters(); 107 } 108 109 public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException { 110 delegate.setObject(parameterIndex, x, targetSqlType); 111 } 112 113 public void setObject(int parameterIndex, Object x) throws SQLException { 114 delegate.setObject(parameterIndex, x); 115 } 116 117 public boolean execute() throws SQLException { 118 return delegate.execute(); 119 } 120 121 public void addBatch() throws SQLException { 122 delegate.addBatch(); 123 } 124 125 public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException { 126 delegate.setCharacterStream(parameterIndex, reader, length); 127 } 128 129 public void setRef(int parameterIndex, Ref x) throws SQLException { 130 delegate.setRef(parameterIndex, x); 131 } 132 133 public void setBlob(int parameterIndex, Blob x) throws SQLException { 134 delegate.setBlob(parameterIndex, x); 135 } 136 137 public void setClob(int parameterIndex, Clob x) throws SQLException { 138 delegate.setClob(parameterIndex, x); 139 } 140 141 public void setArray(int parameterIndex, Array x) throws SQLException { 142 delegate.setArray(parameterIndex, x); 143 } 144 145 public ResultSetMetaData getMetaData() throws SQLException { 146 return delegate.getMetaData(); 147 } 148 149 public void setDate(int parameterIndex, Date x, Calendar cal) throws SQLException { 150 delegate.setDate(parameterIndex, x, cal); 151 } 152 153 public void setTime(int parameterIndex, Time x, Calendar cal) throws SQLException { 154 delegate.setTime(parameterIndex, x, cal); 155 } 156 157 public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) throws SQLException { 158 delegate.setTimestamp(parameterIndex, x, cal); 159 } 160 161 public void setNull(int parameterIndex, int sqlType, String typeName) throws SQLException { 162 delegate.setNull(parameterIndex, sqlType, typeName); 163 } 164 165 public void setURL(int parameterIndex, URL x) throws SQLException { 166 delegate.setURL(parameterIndex, x); 167 } 168 169 public ParameterMetaData getParameterMetaData() throws SQLException { 170 return delegate.getParameterMetaData(); 171 } 172 173 public void setRowId(int parameterIndex, RowId x) throws SQLException { 174 delegate.setRowId(parameterIndex, x); 175 } 176 177 public void setNString(int parameterIndex, String value) throws SQLException { 178 delegate.setNString(parameterIndex, value); 179 } 180 181 public void setNCharacterStream(int parameterIndex, Reader value, long length) 182 throws SQLException { 183 delegate.setNCharacterStream(parameterIndex, value, length); 184 } 185 186 public void setNClob(int parameterIndex, NClob value) throws SQLException { 187 delegate.setNClob(parameterIndex, value); 188 } 189 190 public void setClob(int parameterIndex, Reader reader, long length) throws SQLException { 191 delegate.setClob(parameterIndex, reader, length); 192 } 193 194 public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException { 195 delegate.setBlob(parameterIndex, inputStream, length); 196 } 197 198 public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException { 199 delegate.setNClob(parameterIndex, reader, length); 200 } 201 202 public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException { 203 delegate.setSQLXML(parameterIndex, xmlObject); 204 } 205 206 public void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength) 207 throws SQLException { 208 delegate.setObject(parameterIndex, x, targetSqlType, scaleOrLength); 209 } 210 211 public void setAsciiStream(int parameterIndex, InputStream x, long length) throws SQLException { 212 delegate.setAsciiStream(parameterIndex, x, length); 213 } 214 215 public void setBinaryStream(int parameterIndex, InputStream x, long length) throws SQLException { 216 delegate.setBinaryStream(parameterIndex, x, length); 217 } 218 219 public void setCharacterStream(int parameterIndex, Reader reader, long length) 220 throws SQLException { 221 delegate.setCharacterStream(parameterIndex, reader, length); 222 } 223 224 public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException { 225 delegate.setAsciiStream(parameterIndex, x); 226 } 227 228 public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException { 229 delegate.setBinaryStream(parameterIndex, x); 230 } 231 232 public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException { 233 delegate.setCharacterStream(parameterIndex, reader); 234 } 235 236 public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException { 237 delegate.setNCharacterStream(parameterIndex, value); 238 } 239 240 public void setClob(int parameterIndex, Reader reader) throws SQLException { 241 delegate.setClob(parameterIndex, reader); 242 } 243 244 public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException { 245 delegate.setBlob(parameterIndex, inputStream); 246 } 247 248 public void setNClob(int parameterIndex, Reader reader) throws SQLException { 249 delegate.setNClob(parameterIndex, reader); 250 } 251 252 public ResultSet executeQuery(String sql) throws SQLException { 253 return delegate.executeQuery(sql); 254 } 255 256 public int executeUpdate(String sql) throws SQLException { 257 return delegate.executeUpdate(sql); 258 } 259 260 public void close() throws SQLException { 261 delegate.close(); 262 } 263 264 public int getMaxFieldSize() throws SQLException { 265 return delegate.getMaxFieldSize(); 266 } 267 268 public void setMaxFieldSize(int max) throws SQLException { 269 delegate.setMaxFieldSize(max); 270 } 271 272 public int getMaxRows() throws SQLException { 273 return delegate.getMaxRows(); 274 } 275 276 public void setMaxRows(int max) throws SQLException { 277 delegate.setMaxRows(max); 278 } 279 280 public void setEscapeProcessing(boolean enable) throws SQLException { 281 delegate.setEscapeProcessing(enable); 282 } 283 284 public int getQueryTimeout() throws SQLException { 285 return delegate.getQueryTimeout(); 286 } 287 288 public void setQueryTimeout(int seconds) throws SQLException { 289 delegate.setQueryTimeout(seconds); 290 } 291 292 public void cancel() throws SQLException { 293 delegate.cancel(); 294 } 295 296 public SQLWarning getWarnings() throws SQLException { 297 return delegate.getWarnings(); 298 } 299 300 public void clearWarnings() throws SQLException { 301 delegate.clearWarnings(); 302 } 303 304 public void setCursorName(String name) throws SQLException { 305 delegate.setCursorName(name); 306 } 307 308 public boolean execute(String sql) throws SQLException { 309 return delegate.execute(sql); 310 } 311 312 public ResultSet getResultSet() throws SQLException { 313 return delegate.getResultSet(); 314 } 315 316 public int getUpdateCount() throws SQLException { 317 return delegate.getUpdateCount(); 318 } 319 320 public boolean getMoreResults() throws SQLException { 321 return delegate.getMoreResults(); 322 } 323 324 public void setFetchDirection(int direction) throws SQLException { 325 delegate.setFetchDirection(direction); 326 } 327 328 public int getFetchDirection() throws SQLException { 329 return delegate.getFetchDirection(); 330 } 331 332 public void setFetchSize(int rows) throws SQLException { 333 delegate.setFetchSize(rows); 334 } 335 336 public int getFetchSize() throws SQLException { 337 return delegate.getFetchSize(); 338 } 339 340 public int getResultSetConcurrency() throws SQLException { 341 return delegate.getResultSetConcurrency(); 342 } 343 344 public int getResultSetType() throws SQLException { 345 return delegate.getResultSetType(); 346 } 347 348 public void addBatch(String sql) throws SQLException { 349 delegate.addBatch(sql); 350 } 351 352 public void clearBatch() throws SQLException { 353 delegate.clearBatch(); 354 } 355 356 public int[] executeBatch() throws SQLException { 357 return delegate.executeBatch(); 358 } 359 360 public Connection getConnection() throws SQLException { 361 return delegate.getConnection(); 362 } 363 364 public boolean getMoreResults(int current) throws SQLException { 365 return delegate.getMoreResults(current); 366 } 367 368 public ResultSet getGeneratedKeys() throws SQLException { 369 return delegate.getGeneratedKeys(); 370 } 371 372 public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException { 373 return delegate.executeUpdate(sql, autoGeneratedKeys); 374 } 375 376 public int executeUpdate(String sql, int[] columnIndexes) throws SQLException { 377 return delegate.executeUpdate(sql, columnIndexes); 378 } 379 380 public int executeUpdate(String sql, String[] columnNames) throws SQLException { 381 return delegate.executeUpdate(sql, columnNames); 382 } 383 384 public boolean execute(String sql, int autoGeneratedKeys) throws SQLException { 385 return delegate.execute(sql, autoGeneratedKeys); 386 } 387 388 public boolean execute(String sql, int[] columnIndexes) throws SQLException { 389 return delegate.execute(sql, columnIndexes); 390 } 391 392 public boolean execute(String sql, String[] columnNames) throws SQLException { 393 return delegate.execute(sql, columnNames); 394 } 395 396 public int getResultSetHoldability() throws SQLException { 397 return delegate.getResultSetHoldability(); 398 } 399 400 public boolean isClosed() throws SQLException { 401 return delegate.isClosed(); 402 } 403 404 public void setPoolable(boolean poolable) throws SQLException { 405 delegate.setPoolable(poolable); 406 } 407 408 public boolean isPoolable() throws SQLException { 409 return delegate.isPoolable(); 410 } 411 412 public <T> T unwrap(Class<T> iface) throws SQLException { 413 return delegate.unwrap(iface); 414 } 415 416 public boolean isWrapperFor(Class<?> iface) throws SQLException { 417 return delegate.isWrapperFor(iface); 418 } 419}