1 package com.imcode.db.jdbc; 2 3 import java.sql.*; 4 import java.io.InputStream; 5 import java.io.Reader; 6 import java.math.BigDecimal; 7 import java.util.Calendar; 8 import java.net.URL; 9 10 public class PreparedStatementWrapper implements PreparedStatement { 11 12 protected PreparedStatement preparedStatement ; 13 14 public PreparedStatementWrapper(PreparedStatement preparedStatement) { 15 this.preparedStatement = preparedStatement; 16 } 17 18 public void addBatch() throws SQLException { 19 preparedStatement.addBatch(); 20 } 21 22 public void clearParameters() throws SQLException { 23 preparedStatement.clearParameters(); 24 } 25 26 public boolean execute() throws SQLException { 27 return preparedStatement.execute(); 28 } 29 30 public ResultSet executeQuery() throws SQLException { 31 return preparedStatement.executeQuery(); 32 } 33 34 public int executeUpdate() throws SQLException { 35 return preparedStatement.executeUpdate(); 36 } 37 38 public ResultSetMetaData getMetaData() throws SQLException { 39 return preparedStatement.getMetaData(); 40 } 41 42 public ParameterMetaData getParameterMetaData() throws SQLException { 43 return preparedStatement.getParameterMetaData(); 44 } 45 46 public void setArray(int i, Array x) throws SQLException { 47 preparedStatement.setArray(i, x); 48 } 49 50 public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException { 51 preparedStatement.setAsciiStream(parameterIndex, x, length); 52 } 53 54 public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException { 55 preparedStatement.setBigDecimal(parameterIndex, x); 56 } 57 58 public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException { 59 preparedStatement.setBinaryStream(parameterIndex, x, length); 60 } 61 62 public void setBlob(int i, Blob x) throws SQLException { 63 preparedStatement.setBlob(i, x); 64 } 65 66 public void setBoolean(int parameterIndex, boolean x) throws SQLException { 67 preparedStatement.setBoolean(parameterIndex, x); 68 } 69 70 public void setByte(int parameterIndex, byte x) throws SQLException { 71 preparedStatement.setByte(parameterIndex, x); 72 } 73 74 public void setBytes(int parameterIndex, byte[] x) throws SQLException { 75 preparedStatement.setBytes(parameterIndex, x); 76 } 77 78 public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException { 79 preparedStatement.setCharacterStream(parameterIndex, reader, length); 80 } 81 82 public void setClob(int i, Clob x) throws SQLException { 83 preparedStatement.setClob(i, x); 84 } 85 86 public void setDate(int parameterIndex, Date x) throws SQLException { 87 preparedStatement.setDate(parameterIndex, x); 88 } 89 90 public void setDate(int parameterIndex, Date x, Calendar cal) throws SQLException { 91 preparedStatement.setDate(parameterIndex, x, cal); 92 } 93 94 public void setDouble(int parameterIndex, double x) throws SQLException { 95 preparedStatement.setDouble(parameterIndex, x); 96 } 97 98 public void setFloat(int parameterIndex, float x) throws SQLException { 99 preparedStatement.setFloat(parameterIndex, x); 100 } 101 102 public void setInt(int parameterIndex, int x) throws SQLException { 103 preparedStatement.setInt(parameterIndex, x); 104 } 105 106 public void setLong(int parameterIndex, long x) throws SQLException { 107 preparedStatement.setLong(parameterIndex, x); 108 } 109 110 public void setNull(int parameterIndex, int sqlType) throws SQLException { 111 preparedStatement.setNull(parameterIndex, sqlType); 112 } 113 114 public void setNull(int paramIndex, int sqlType, String typeName) throws SQLException { 115 preparedStatement.setNull(paramIndex, sqlType, typeName); 116 } 117 118 public void setObject(int parameterIndex, Object x) throws SQLException { 119 preparedStatement.setObject(parameterIndex, x); 120 } 121 122 public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException { 123 preparedStatement.setObject(parameterIndex, x, targetSqlType); 124 } 125 126 public void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException { 127 preparedStatement.setObject(parameterIndex, x, targetSqlType, scale); 128 } 129 130 public void setRef(int i, Ref x) throws SQLException { 131 preparedStatement.setRef(i, x); 132 } 133 134 public void setShort(int parameterIndex, short x) throws SQLException { 135 preparedStatement.setShort(parameterIndex, x); 136 } 137 138 public void setString(int parameterIndex, String x) throws SQLException { 139 preparedStatement.setString(parameterIndex, x); 140 } 141 142 public void setTime(int parameterIndex, Time x) throws SQLException { 143 preparedStatement.setTime(parameterIndex, x); 144 } 145 146 public void setTime(int parameterIndex, Time x, Calendar cal) throws SQLException { 147 preparedStatement.setTime(parameterIndex, x, cal); 148 } 149 150 public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException { 151 preparedStatement.setTimestamp(parameterIndex, x); 152 } 153 154 public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) throws SQLException { 155 preparedStatement.setTimestamp(parameterIndex, x, cal); 156 } 157 158 public void setUnicodeStream(int parameterIndex, InputStream x, int length) throws SQLException { 159 preparedStatement.setUnicodeStream(parameterIndex, x, length); 160 } 161 162 public void setURL(int parameterIndex, URL x) throws SQLException { 163 preparedStatement.setURL(parameterIndex, x); 164 } 165 166 public void addBatch(String sql) throws SQLException { 167 preparedStatement.addBatch(sql); 168 } 169 170 public void cancel() throws SQLException { 171 preparedStatement.cancel(); 172 } 173 174 public void clearBatch() throws SQLException { 175 preparedStatement.clearBatch(); 176 } 177 178 public void clearWarnings() throws SQLException { 179 preparedStatement.clearWarnings(); 180 } 181 182 public void close() throws SQLException { 183 preparedStatement.close(); 184 } 185 186 public boolean execute(String sql) throws SQLException { 187 return preparedStatement.execute(sql); 188 } 189 190 public boolean execute(String sql, int autoGeneratedKeys) throws SQLException { 191 return preparedStatement.execute(sql, autoGeneratedKeys); 192 } 193 194 public boolean execute(String sql, int[] columnIndexes) throws SQLException { 195 return preparedStatement.execute(sql, columnIndexes); 196 } 197 198 public boolean execute(String sql, String[] columnNames) throws SQLException { 199 return preparedStatement.execute(sql, columnNames); 200 } 201 202 public int[] executeBatch() throws SQLException { 203 return preparedStatement.executeBatch(); 204 } 205 206 public ResultSet executeQuery(String sql) throws SQLException { 207 return preparedStatement.executeQuery(sql); 208 } 209 210 public int executeUpdate(String sql) throws SQLException { 211 return preparedStatement.executeUpdate(sql); 212 } 213 214 public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException { 215 return preparedStatement.executeUpdate(sql, autoGeneratedKeys); 216 } 217 218 public int executeUpdate(String sql, int[] columnIndexes) throws SQLException { 219 return preparedStatement.executeUpdate(sql, columnIndexes); 220 } 221 222 public int executeUpdate(String sql, String[] columnNames) throws SQLException { 223 return preparedStatement.executeUpdate(sql, columnNames); 224 } 225 226 public Connection getConnection() throws SQLException { 227 return preparedStatement.getConnection(); 228 } 229 230 public int getFetchDirection() throws SQLException { 231 return preparedStatement.getFetchDirection(); 232 } 233 234 public int getFetchSize() throws SQLException { 235 return preparedStatement.getFetchSize(); 236 } 237 238 public ResultSet getGeneratedKeys() throws SQLException { 239 return preparedStatement.getGeneratedKeys(); 240 } 241 242 public int getMaxFieldSize() throws SQLException { 243 return preparedStatement.getMaxFieldSize(); 244 } 245 246 public int getMaxRows() throws SQLException { 247 return preparedStatement.getMaxRows(); 248 } 249 250 public boolean getMoreResults() throws SQLException { 251 return preparedStatement.getMoreResults(); 252 } 253 254 public boolean getMoreResults(int current) throws SQLException { 255 return preparedStatement.getMoreResults(current); 256 } 257 258 public int getQueryTimeout() throws SQLException { 259 return preparedStatement.getQueryTimeout(); 260 } 261 262 public ResultSet getResultSet() throws SQLException { 263 return preparedStatement.getResultSet(); 264 } 265 266 public int getResultSetConcurrency() throws SQLException { 267 return preparedStatement.getResultSetConcurrency(); 268 } 269 270 public int getResultSetHoldability() throws SQLException { 271 return preparedStatement.getResultSetHoldability(); 272 } 273 274 public int getResultSetType() throws SQLException { 275 return preparedStatement.getResultSetType(); 276 } 277 278 public int getUpdateCount() throws SQLException { 279 return preparedStatement.getUpdateCount(); 280 } 281 282 public SQLWarning getWarnings() throws SQLException { 283 return preparedStatement.getWarnings(); 284 } 285 286 public void setCursorName(String name) throws SQLException { 287 preparedStatement.setCursorName(name); 288 } 289 290 public void setEscapeProcessing(boolean enable) throws SQLException { 291 preparedStatement.setEscapeProcessing(enable); 292 } 293 294 public void setFetchDirection(int direction) throws SQLException { 295 preparedStatement.setFetchDirection(direction); 296 } 297 298 public void setFetchSize(int rows) throws SQLException { 299 preparedStatement.setFetchSize(rows); 300 } 301 302 public void setMaxFieldSize(int max) throws SQLException { 303 preparedStatement.setMaxFieldSize(max); 304 } 305 306 public void setMaxRows(int max) throws SQLException { 307 preparedStatement.setMaxRows(max); 308 } 309 310 public void setQueryTimeout(int seconds) throws SQLException { 311 preparedStatement.setQueryTimeout(seconds); 312 } 313 }