18 package com.mysql.clusterj.jdbc;
20 import java.math.BigDecimal;
21 import java.math.BigInteger;
23 import java.sql.SQLException;
25 import java.sql.Timestamp;
27 import com.mysql.clusterj.ClusterJDatastoreException;
28 import com.mysql.clusterj.ClusterJFatalInternalException;
29 import com.mysql.clusterj.ColumnMetadata;
30 import com.mysql.clusterj.core.spi.DomainTypeHandler;
31 import com.mysql.clusterj.core.spi.ValueHandler;
32 import com.mysql.clusterj.core.util.I18NHelper;
33 import com.mysql.clusterj.core.util.Logger;
34 import com.mysql.clusterj.core.util.LoggerFactoryService;
36 import com.mysql.jdbc.ParameterBindings;
49 private ParameterBindings parameterBindings;
50 private int[] fieldNumberMap;
55 public ValueHandlerImpl(ParameterBindings parameterBindings,
int[] fieldNumberMap,
int offset) {
56 this.parameterBindings = parameterBindings;
57 this.fieldNumberMap = fieldNumberMap;
61 public ValueHandlerImpl(ParameterBindings parameterBindings,
int[] fieldNumberMap) {
62 this(parameterBindings, fieldNumberMap, 0);
65 public BigDecimal getBigDecimal(
int fieldNumber) {
67 return parameterBindings.getBigDecimal(offset + fieldNumberMap[fieldNumber]);
68 }
catch (SQLException e) {
73 public BigInteger getBigInteger(
int fieldNumber) {
75 return parameterBindings.getBigDecimal(offset + fieldNumberMap[fieldNumber]).toBigInteger();
76 }
catch (SQLException e) {
81 public boolean getBoolean(
int fieldNumber) {
83 return parameterBindings.getBoolean(offset + fieldNumberMap[fieldNumber]);
84 }
catch (SQLException e) {
89 public boolean[] getBooleans(
int fieldNumber) {
93 public byte getByte(
int fieldNumber) {
95 return parameterBindings.getByte(offset + fieldNumberMap[fieldNumber]);
96 }
catch (SQLException e) {
101 public byte[] getBytes(
int fieldNumber) {
105 public double getDouble(
int fieldNumber) {
107 return parameterBindings.getDouble(offset + fieldNumberMap[fieldNumber]);
108 }
catch (SQLException e) {
113 public float getFloat(
int fieldNumber) {
115 return parameterBindings.getFloat(offset + fieldNumberMap[fieldNumber]);
116 }
catch (SQLException e) {
121 public int getInt(
int fieldNumber) {
123 return parameterBindings.getInt(offset + fieldNumberMap[fieldNumber]);
124 }
catch (SQLException e) {
129 public Date getJavaSqlDate(
int fieldNumber) {
131 return parameterBindings.getDate(offset + fieldNumberMap[fieldNumber]);
132 }
catch (SQLException e) {
137 public Time getJavaSqlTime(
int fieldNumber) {
139 return parameterBindings.getTime(offset + fieldNumberMap[fieldNumber]);
140 }
catch (SQLException e) {
145 public Timestamp getJavaSqlTimestamp(
int fieldNumber) {
147 return parameterBindings.getTimestamp(offset + fieldNumberMap[fieldNumber]);
148 }
catch (SQLException e) {
153 public java.util.Date getJavaUtilDate(
int fieldNumber) {
155 return parameterBindings.getDate(offset + fieldNumberMap[fieldNumber]);
156 }
catch (SQLException e) {
161 public long getLong(
int fieldNumber) {
163 return parameterBindings.getLong(offset + fieldNumberMap[fieldNumber]);
164 }
catch (SQLException e) {
169 public Boolean getObjectBoolean(
int fieldNumber) {
173 public Byte getObjectByte(
int fieldNumber) {
175 return parameterBindings.getByte(offset + fieldNumberMap[fieldNumber]);
176 }
catch (SQLException e) {
181 public Double getObjectDouble(
int fieldNumber) {
183 return parameterBindings.getDouble(offset + fieldNumberMap[fieldNumber]);
184 }
catch (SQLException e) {
189 public Float getObjectFloat(
int fieldNumber) {
191 return parameterBindings.getFloat(offset + fieldNumberMap[fieldNumber]);
192 }
catch (SQLException e) {
197 public Integer getObjectInt(
int fieldNumber) {
199 return parameterBindings.getInt(offset + fieldNumberMap[fieldNumber]);
200 }
catch (SQLException e) {
205 public Long getObjectLong(
int fieldNumber) {
207 return parameterBindings.getLong(offset + fieldNumberMap[fieldNumber]);
208 }
catch (SQLException e) {
213 public Short getObjectShort(
int fieldNumber) {
215 return parameterBindings.getShort(offset + fieldNumberMap[fieldNumber]);
216 }
catch (SQLException e) {
221 public short getShort(
int fieldNumber) {
223 return parameterBindings.getShort(offset + fieldNumberMap[fieldNumber]);
224 }
catch (SQLException e) {
229 public String getString(
int fieldNumber) {
231 return parameterBindings.getString(offset + fieldNumberMap[fieldNumber]);
232 }
catch (SQLException e) {
237 public boolean isModified(
int fieldNumber) {
238 return fieldNumberMap[fieldNumber] != -1;
241 public boolean isNull(
int fieldNumber) {
243 return parameterBindings.isNull(offset + fieldNumberMap[fieldNumber]);
244 }
catch (SQLException e) {
249 public void markModified(
int fieldNumber) {
253 public String pkToString(DomainTypeHandler<?> domainTypeHandler) {
257 public void resetModified() {
261 public void setBigDecimal(
int fieldNumber, BigDecimal value) {
265 public void setBigInteger(
int fieldNumber, BigInteger bigIntegerExact) {
269 public void setBoolean(
int fieldNumber,
boolean b) {
273 public void setBooleans(
int fieldNumber,
boolean[] b) {
277 public void setByte(
int fieldNumber, byte value) {
281 public void setBytes(
int fieldNumber, byte[] value) {
285 public void setDouble(
int fieldNumber,
double value) {
289 public void setFloat(
int fieldNumber,
float value) {
293 public void setInt(
int fieldNumber,
int value) {
297 public void setJavaSqlDate(
int fieldNumber, Date value) {
301 public void setJavaSqlTime(
int fieldNumber, Time value) {
305 public void setJavaSqlTimestamp(
int fieldNumber, Timestamp value) {
309 public void setJavaUtilDate(
int fieldNumber, java.util.Date value) {
313 public void setLong(
int fieldNumber,
long value) {
317 public void setObject(
int fieldNumber, Object value) {
321 public void setObjectBoolean(
int fieldNumber, Boolean value) {
325 public void setObjectByte(
int fieldNumber, Byte value) {
329 public void setObjectDouble(
int fieldNumber, Double value) {
333 public void setObjectFloat(
int fieldNumber, Float value) {
337 public void setObjectInt(
int fieldNumber, Integer value) {
341 public void setObjectLong(
int fieldNumber, Long value) {
345 public void setObjectShort(
int fieldNumber, Short value) {
349 public void setShort(
int fieldNumber,
short value) {
353 public void setString(
int fieldNumber,
String value) {
361 public Boolean found() {
365 public void found(Boolean found) {
369 public Object
get(
int columnNumber) {
373 public void set(
int columnNumber, Object value) {