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