1 2 3 package com.opensourceconnections.msjdbcproxy; 4 5 import java.io.InputStream; 6 import java.io.Reader; 7 import java.math.BigDecimal; 8 import java.net.URL; 9 import java.sql.Array; 10 import java.sql.Blob; 11 import java.sql.Clob; 12 import java.sql.Date; 13 import java.sql.ParameterMetaData; 14 import java.sql.PreparedStatement; 15 import java.sql.Ref; 16 import java.sql.ResultSet; 17 import java.sql.ResultSetMetaData; 18 import java.sql.SQLException; 19 import java.sql.Time; 20 import java.sql.Timestamp; 21 import java.util.Calendar; 22 23 public class PreparedStatementProxy extends StatementProxy implements PreparedStatement 24 { 25 public PreparedStatementProxy(ConnectionProxy connection, PreparedStatement statement) 26 { 27 super(connection, statement); 28 } 29 30 public ResultSet executeQuery() throws SQLException 31 { 32 return new ResultSetProxy(this, ((PreparedStatement)_statement).executeQuery()); 33 } 34 35 public int executeUpdate() throws SQLException 36 { 37 return ((PreparedStatement)_statement).executeUpdate(); 38 } 39 40 public void setNull(int parameterIndex, int sqlType) throws SQLException 41 { 42 ((PreparedStatement)_statement).setNull(parameterIndex, sqlType); 43 } 44 45 public void setBoolean(int parameterIndex, boolean x) throws SQLException 46 { 47 ((PreparedStatement)_statement).setBoolean(parameterIndex, x); 48 } 49 50 public void setByte(int parameterIndex, byte x) throws SQLException 51 { 52 ((PreparedStatement)_statement).setByte(parameterIndex, x); 53 } 54 55 public void setShort(int parameterIndex, short x) throws SQLException 56 { 57 ((PreparedStatement)_statement).setShort(parameterIndex, x); 58 } 59 60 public void setInt(int parameterIndex, int x) throws SQLException 61 { 62 ((PreparedStatement)_statement).setInt(parameterIndex, x); 63 } 64 65 public void setLong(int parameterIndex, long x) throws SQLException 66 { 67 ((PreparedStatement)_statement).setLong(parameterIndex, x); 68 } 69 70 public void setFloat(int parameterIndex, float x) throws SQLException 71 { 72 ((PreparedStatement)_statement).setFloat(parameterIndex, x); 73 } 74 75 public void setDouble(int parameterIndex, double x) throws SQLException 76 { 77 ((PreparedStatement)_statement).setDouble(parameterIndex, x); 78 } 79 80 public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException 81 { 82 ((PreparedStatement)_statement).setBigDecimal(parameterIndex, x); 83 } 84 85 public void setString(int parameterIndex, String x) throws SQLException 86 { 87 ((PreparedStatement)_statement).setString(parameterIndex, x); 88 } 89 90 public void setBytes(int parameterIndex, byte x[]) throws SQLException 91 { 92 ((PreparedStatement)_statement).setBytes(parameterIndex, x); 93 } 94 95 public void setDate(int parameterIndex, Date x) throws SQLException 96 { 97 ((PreparedStatement)_statement).setDate(parameterIndex, x); 98 } 99 100 public void setTime(int parameterIndex, Time x) throws SQLException 101 { 102 ((PreparedStatement)_statement).setTime(parameterIndex, x); 103 } 104 105 public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException 106 { 107 ((PreparedStatement)_statement).setTimestamp(parameterIndex, x); 108 } 109 110 public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException 111 { 112 ((PreparedStatement)_statement).setAsciiStream(parameterIndex, x, length); 113 } 114 115 public void setUnicodeStream(int parameterIndex, InputStream x, int length) throws SQLException 116 { 117 ((PreparedStatement)_statement).setUnicodeStream(parameterIndex, x, length); 118 } 119 120 public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException 121 { 122 ((PreparedStatement)_statement).setBinaryStream(parameterIndex, x, length); 123 } 124 125 public void clearParameters() throws SQLException 126 { 127 ((PreparedStatement)_statement).clearParameters(); 128 } 129 130 public void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException 131 { 132 ((PreparedStatement)_statement).setObject(parameterIndex, x, targetSqlType, scale); 133 } 134 135 public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException 136 { 137 ((PreparedStatement)_statement).setObject(parameterIndex, x, targetSqlType); 138 } 139 140 public void setObject(int parameterIndex, Object x) throws SQLException 141 { 142 ((PreparedStatement)_statement).setObject(parameterIndex, x); 143 } 144 145 public boolean execute() throws SQLException 146 { 147 return ((PreparedStatement)_statement).execute(); 148 } 149 150 public void addBatch() throws SQLException 151 { 152 ((PreparedStatement)_statement).addBatch(); 153 } 154 155 public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException 156 { 157 ((PreparedStatement)_statement).setCharacterStream(parameterIndex, reader, length); 158 } 159 160 public void setRef(int i, Ref x) throws SQLException 161 { 162 ((PreparedStatement)_statement).setRef(i, x); 163 } 164 165 public void setBlob(int i, Blob x) throws SQLException 166 { 167 ((PreparedStatement)_statement).setBlob(i, x); 168 } 169 170 public void setClob(int i, Clob x) throws SQLException 171 { 172 ((PreparedStatement)_statement).setClob(i, x); 173 } 174 175 public void setArray(int i, Array x) throws SQLException 176 { 177 ((PreparedStatement)_statement).setArray(i, x); 178 } 179 180 public ResultSetMetaData getMetaData() throws SQLException 181 { 182 return ((PreparedStatement)_statement).getMetaData(); 183 } 184 185 public void setDate(int parameterIndex, Date x, Calendar cal) throws SQLException 186 { 187 ((PreparedStatement)_statement).setDate(parameterIndex, x, cal); 188 } 189 190 public void setTime(int parameterIndex, Time x, Calendar cal) throws SQLException 191 { 192 ((PreparedStatement)_statement).setTime(parameterIndex, x, cal); 193 } 194 195 public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) throws SQLException 196 { 197 ((PreparedStatement)_statement).setTimestamp(parameterIndex, x, cal); 198 } 199 200 public void setNull(int paramIndex, int sqlType, String typeName) throws SQLException 201 { 202 ((PreparedStatement)_statement).setNull(paramIndex, sqlType, typeName); 203 } 204 205 public void setURL(int parameterIndex, URL x) throws SQLException 206 { 207 ((PreparedStatement)_statement).setURL(parameterIndex, x); 208 } 209 210 public ParameterMetaData getParameterMetaData() throws SQLException 211 { 212 return ((PreparedStatement)_statement).getParameterMetaData(); 213 } 214 }