1 16 package com.ibatis.sqlmap.engine.type; 17 18 import com.ibatis.sqlmap.client.extensions.ParameterSetter; 19 20 import java.io.InputStream ; 21 import java.io.Reader ; 22 import java.math.BigDecimal ; 23 import java.net.URL ; 24 import java.sql.*; 25 import java.util.Calendar ; 26 27 30 public class ParameterSetterImpl implements ParameterSetter { 31 32 private PreparedStatement ps; 33 private int index; 34 35 41 public ParameterSetterImpl(PreparedStatement statement, int columnIndex) { 42 this.ps = statement; 43 this.index = columnIndex; 44 } 45 46 public void setArray(Array x) throws SQLException { 47 ps.setArray(index, x); 48 } 49 50 public void setAsciiStream(InputStream x, int length) throws SQLException { 51 ps.setAsciiStream(index, x, length); 52 } 53 54 public void setBigDecimal(BigDecimal x) throws SQLException { 55 ps.setBigDecimal(index, x); 56 } 57 58 public void setBinaryStream(InputStream x, int length) throws SQLException { 59 ps.setBinaryStream(index, x, length); 60 } 61 62 public void setBlob(Blob x) throws SQLException { 63 ps.setBlob(index, x); 64 } 65 66 public void setBoolean(boolean x) throws SQLException { 67 ps.setBoolean(index, x); 68 } 69 70 public void setByte(byte x) throws SQLException { 71 ps.setByte(index, x); 72 } 73 74 public void setBytes(byte x[]) throws SQLException { 75 ps.setBytes(index, x); 76 } 77 78 public void setCharacterStream(Reader reader, int length) throws SQLException { 79 ps.setCharacterStream(index, reader, length); 80 } 81 82 public void setClob(Clob x) throws SQLException { 83 ps.setClob(index, x); 84 } 85 86 public void setDate(Date x) throws SQLException { 87 ps.setDate(index, x); 88 } 89 90 public void setDate(Date x, Calendar cal) throws SQLException { 91 ps.setDate(index, x, cal); 92 } 93 94 public void setDouble(double x) throws SQLException { 95 ps.setDouble(index, x); 96 } 97 98 public void setFloat(float x) throws SQLException { 99 ps.setFloat(index, x); 100 } 101 102 public void setInt(int x) throws SQLException { 103 ps.setInt(index, x); 104 } 105 106 public void setLong(long x) throws SQLException { 107 ps.setLong(index, x); 108 } 109 110 public void setNull(int sqlType) throws SQLException { 111 ps.setNull(index, sqlType); 112 } 113 114 public void setNull(int sqlType, String typeName) throws SQLException { 115 ps.setNull(index, sqlType, typeName); 116 } 117 118 public void setObject(Object x) throws SQLException { 119 ps.setObject(index, x); 120 } 121 122 public void setObject(Object x, int targetSqlType) throws SQLException { 123 ps.setObject(index, x, targetSqlType); 124 } 125 126 public void setObject(Object x, int targetSqlType, int scale) throws SQLException { 127 ps.setObject(index, x, scale); 128 } 129 130 public void setRef(Ref x) throws SQLException { 131 ps.setRef(index, x); 132 } 133 134 public void setShort(short x) throws SQLException { 135 ps.setShort(index, x); 136 } 137 138 public void setString(String x) throws SQLException { 139 ps.setString(index, x); 140 } 141 142 public void setTime(Time x) throws SQLException { 143 ps.setTime(index, x); 144 } 145 146 public void setTime(Time x, Calendar cal) throws SQLException { 147 ps.setTime(index, x, cal); 148 } 149 150 public void setTimestamp(Timestamp x) throws SQLException { 151 ps.setTimestamp(index, x); 152 } 153 154 public void setTimestamp(Timestamp x, Calendar cal) throws SQLException { 155 ps.setTimestamp(index, x, cal); 156 } 157 158 public void setURL(URL x) throws SQLException { 159 ps.setURL(index, x); 160 } 161 162 public PreparedStatement getPreparedStatement() { 163 return ps; 164 } 165 166 } 167 | Popular Tags |