1 /* $Id: BindPreparedStatementImpl.java 413 2011-07-28 23:05:11Z dobashi $
\r
2 * created: 2005/06/17
\r
5 package com.lavans.luz2.sql.bind;
\r
7 import java.io.InputStream;
\r
8 import java.io.Reader;
\r
9 import java.math.BigDecimal;
\r
10 import java.net.URL;
\r
11 import java.sql.Array;
\r
12 import java.sql.Blob;
\r
13 import java.sql.Clob;
\r
14 import java.sql.Date;
\r
15 import java.sql.NClob;
\r
16 import java.sql.ParameterMetaData;
\r
17 import java.sql.PreparedStatement;
\r
18 import java.sql.Ref;
\r
19 import java.sql.ResultSet;
\r
20 import java.sql.ResultSetMetaData;
\r
21 import java.sql.RowId;
\r
22 import java.sql.SQLException;
\r
23 import java.sql.SQLXML;
\r
24 import java.sql.Time;
\r
25 import java.sql.Timestamp;
\r
26 import java.text.SimpleDateFormat;
\r
27 import java.util.ArrayList;
\r
28 import java.util.Calendar;
\r
29 import java.util.List;
\r
30 import java.util.Map;
\r
32 import org.apache.commons.logging.Log;
\r
33 import org.apache.commons.logging.LogFactory;
\r
35 import com.lavans.luz2.commons.StringUtils;
\r
36 import com.lavans.luz2.sql.logging.Loggable;
\r
37 import com.lavans.luz2.sql.logging.LoggingStatement;
\r
38 import com.lavans.luz2.util.MethodUtil;
\r
44 public class BindPreparedStatementImpl extends LoggingStatement implements BindPreparedStatement {
\r
45 private static Log logger = LogFactory.getLog(BindPreparedStatementImpl.class);
\r
46 /** 自クラス名。使うたびにgetName()すると遅くなるのでここで定義しておく。 */
\r
47 private static final String CLASSNAME=BindPreparedStatementImpl.class.getName();
\r
49 private PreparedStatement st = null;
\r
52 * パラメータ名と「何番目のパラメータか」を保持するMap。 一つのパラメータ名で複数のパラメータを表す場合があるので、
\r
53 * valueはIntegerのListとする。 配列が可変長なので、int[]型では配列数制御の実装をしなければならない。
\r
55 private Map<String, List<Integer>> paramMap = null;
\r
61 * ログ用にバインドキー文字列(:member_id)を実際の値に変換する。
\r
65 private void logParam(String key, String value){
\r
67 value = value.replace("$", "\\$");
\r
70 sql = sql.replaceAll(key+" ", value+" ");
\r
71 sql = sql.replaceAll(key+",", value+",");
\r
72 sql = sql.replaceAll(key+"\t", value+"\t");
\r
73 sql = sql.replaceAll(key+"\n", value+"\n");
\r
74 sql = sql.replaceAll(key+"\r", value+"\r");
\r
75 sql = sql.replaceAll(key+"\\)", value+"\\)");
\r
76 sql = sql.replaceAll(key+"$", value+"");
\r
84 public BindPreparedStatementImpl(PreparedStatement st, String sql, Map<String, List<Integer>> paramMap) {
\r
88 this.paramMap = paramMap;
\r
90 // 移譲先もLoggableな場合は移譲先にもlog用sqlを渡す。
\r
91 if (st instanceof Loggable) {
\r
92 ((Loggable) st).setLogsql(sql);
\r
98 * LIMIT OFFSETに対するセットを実装するときにはsetIntにする必要あり(Postgres)。
\r
99 * ソート順は顧客に入力させずにコンボで選ばせるようにすればよい。
\r
100 * @throws SQLException
\r
102 public void setParams(Map<String, Object> params) throws SQLException{
\r
103 if(params==null) return;
\r
105 List<String> list = new ArrayList<String>(params.keySet());
\r
106 for(int i=0; i < list.size(); i++){
\r
107 String key = list.get(i);
\r
108 Object value = params.get(key);
\r
109 if(value instanceof String){
\r
110 setString(key, (String)value);
\r
111 }else if(value instanceof Integer){
\r
112 setInt(key, ((Integer)value).intValue());
\r
113 }else if(value instanceof Long){
\r
114 setLong(key, (Long)value);
\r
115 }else if(value instanceof java.util.Date){
\r
116 setTimestamp(key,new Timestamp(((java.util.Date)value).getTime()));
\r
117 }else if(value instanceof Boolean){
\r
118 setBoolean(key, (Boolean)value);
\r
119 }else if(value instanceof byte[]){
\r
120 // setObjectまかせでいいかもしれない
\r
121 setBytes(key, (byte[])value);
\r
123 setObject(key, value);
\r
125 logger.debug("bind as object["+ key +":NULL]");
\r
127 logger.debug("bind as object["+ key +":"+ value.getClass().getName() +"]");
\r
134 * パラメータ名での設定(String)。
\r
138 * @throws SQLException
\r
140 public void setString(String key, String x) throws SQLException {
\r
141 List<Integer> paramNums = paramMap.get(key);
\r
142 if (paramNums == null) {
\r
143 throw new SQLException("No such key [" + key + "]");
\r
145 for (int i = 0; i < paramNums.size(); i++) {
\r
146 Integer num = paramNums.get(i);
\r
147 st.setString(num.intValue(), x);
\r
148 logger.debug( "[" + num + "]:" + key + "[" + x + "]");
\r
153 logParam(":"+key, "NULL");
\r
155 logParam(":"+key, "'"+x+"'");
\r
165 * @throws SQLException
\r
167 public void setInt(String key, int x) throws SQLException {
\r
168 List<Integer> paramNums = paramMap.get(key);
\r
169 if (paramNums == null) {
\r
170 throw new SQLException("No such key [" + key + "]");
\r
172 for (int i = 0; i < paramNums.size(); i++) {
\r
173 Integer num = paramNums.get(i);
\r
174 st.setInt(num.intValue(), x);
\r
175 logger.debug( "[" + num + "]:" + key + "[" + x + "]");
\r
179 logParam(":"+key, String.valueOf(x));
\r
183 * パラメータ名での設定(byte)。
\r
187 * @throws SQLException
\r
189 public void setByte(String key, byte x) throws SQLException {
\r
190 List<Integer> paramNums = paramMap.get(key);
\r
191 if (paramNums == null) {
\r
192 throw new SQLException("No such key [" + key + "]");
\r
194 for (int i = 0; i < paramNums.size(); i++) {
\r
195 Integer num = paramNums.get(i);
\r
196 st.setByte(num.intValue(), x);
\r
199 logParam(":"+key, String.valueOf(x));
\r
203 * パラメータ名での設定(float)。
\r
207 * @throws SQLException
\r
209 public void setFloat(String key, float x) throws SQLException {
\r
210 List<Integer> paramNums = paramMap.get(key);
\r
211 if (paramNums == null) {
\r
212 throw new SQLException("No such key [" + key + "]");
\r
214 for (int i = 0; i < paramNums.size(); i++) {
\r
215 Integer num = paramNums.get(i);
\r
216 st.setFloat(num.intValue(), x);
\r
219 logParam(":"+key, String.valueOf(x));
\r
223 * パラメータ名での設定(double)。
\r
227 * @throws SQLException
\r
229 public void setDouble(String key, double x) throws SQLException {
\r
230 List<Integer> paramNums = paramMap.get(key);
\r
231 if (paramNums == null) {
\r
232 throw new SQLException("No such key [" + key + "]");
\r
234 for (int i = 0; i < paramNums.size(); i++) {
\r
235 Integer num = paramNums.get(i);
\r
236 st.setDouble(num.intValue(), x);
\r
239 logParam(":"+key, String.valueOf(x));
\r
243 * パラメータ名での設定(null)。
\r
247 * @throws SQLException
\r
249 public void setNull(String key, int sqlType) throws SQLException {
\r
250 List<Integer> paramNums = paramMap.get(key);
\r
251 if (paramNums == null) {
\r
252 throw new SQLException("No such key [" + key + "]");
\r
254 for (int i = 0; i < paramNums.size(); i++) {
\r
255 Integer num = paramNums.get(i);
\r
256 st.setNull(num.intValue(), sqlType);
\r
259 logParam(":"+key, "NULL");
\r
263 * パラメータ名での設定(long)。
\r
267 * @throws SQLException
\r
269 public void setLong(String key, long x) throws SQLException {
\r
270 List<Integer> paramNums = paramMap.get(key);
\r
271 if (paramNums == null) {
\r
272 throw new SQLException("No such key [" + key + "]");
\r
274 for (int i = 0; i < paramNums.size(); i++) {
\r
275 Integer num = paramNums.get(i);
\r
276 st.setLong(num.intValue(), x);
\r
279 logParam(":"+key, String.valueOf(x));
\r
283 * パラメータ名での設定(short)。
\r
287 * @throws SQLException
\r
289 public void setShort(String key, short x) throws SQLException {
\r
290 List<Integer> paramNums = paramMap.get(key);
\r
291 if (paramNums == null) {
\r
292 throw new SQLException("No such key [" + key + "]");
\r
294 for (int i = 0; i < paramNums.size(); i++) {
\r
295 Integer num = paramNums.get(i);
\r
296 st.setShort(num.intValue(), x);
\r
298 logParam(":"+key, String.valueOf(x));
\r
302 * パラメータ名での設定(boolean)。
\r
306 * @throws SQLException
\r
308 public void setBoolean(String key, boolean x) throws SQLException {
\r
309 List<Integer> paramNums = paramMap.get(key);
\r
310 if (paramNums == null) {
\r
311 throw new SQLException("No such key [" + key + "]");
\r
313 for (int i = 0; i < paramNums.size(); i++) {
\r
314 Integer num = paramNums.get(i);
\r
315 st.setBoolean(num.intValue(), x);
\r
317 logParam(":"+key, String.valueOf(x));
\r
321 * パラメータ名での設定(byte[])。
\r
325 * @throws SQLException
\r
327 public void setBytes(String key, byte[] x) throws SQLException {
\r
328 List<Integer> paramNums = paramMap.get(key);
\r
329 if (paramNums == null) {
\r
330 throw new SQLException("No such key [" + key + "]");
\r
332 for (int i = 0; i < paramNums.size(); i++) {
\r
333 Integer num = paramNums.get(i);
\r
334 st.setBytes(num.intValue(), x);
\r
338 logParam(":"+key, "NULL");
\r
339 }else if(x.length<=10){
\r
341 logParam(":"+key, "'"+StringUtils.toHex(x, ":")+"'");
\r
343 byte[] x2 = new byte[10];
\r
344 System.arraycopy(x, 0, x2, 0, 10);
\r
345 logParam(":"+key, "'"+StringUtils.toHex(x2, ":")+"...'");
\r
350 * パラメータ名での設定(java.sql.Date)。
\r
354 * @throws SQLException
\r
356 public void setDate(String key, Date x) throws SQLException {
\r
357 List<Integer> paramNums = paramMap.get(key);
\r
358 if (paramNums == null) {
\r
359 throw new SQLException("No such key [" + key + "]");
\r
361 for (int i = 0; i < paramNums.size(); i++) {
\r
362 Integer num = paramNums.get(i);
\r
363 st.setDate(num.intValue(), x);
\r
368 logParam(":"+key, "NULL");
\r
370 SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
\r
371 logParam(":"+key, "'"+sdf.format(x)+"'");
\r
376 * パラメータ名での設定(java.sql.Time)。
\r
380 * @throws SQLException
\r
382 public void setTime(String key, Time x) throws SQLException {
\r
383 List<Integer> paramNums = paramMap.get(key);
\r
384 if (paramNums == null) {
\r
385 throw new SQLException("No such key [" + key + "]");
\r
387 for (int i = 0; i < paramNums.size(); i++) {
\r
388 Integer num = paramNums.get(i);
\r
389 st.setTime(num.intValue(), x);
\r
394 logParam(":"+key, "NULL");
\r
396 SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
\r
397 logParam(":"+key, "'"+sdf.format(x)+"'");
\r
402 * パラメータ名での設定(java.sql.Timestamp)。
\r
406 * @throws SQLException
\r
408 public void setTimestamp(String key, Timestamp x) throws SQLException {
\r
409 List<Integer> paramNums = paramMap.get(key);
\r
410 if (paramNums == null) {
\r
411 throw new SQLException("No such key [" + key + "]");
\r
413 for (int i = 0; i < paramNums.size(); i++) {
\r
414 Integer num = paramNums.get(i);
\r
415 st.setTimestamp(num.intValue(), x);
\r
420 logParam(":"+key, "NULL");
\r
422 SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
\r
423 logParam(":"+key, "'"+sdf.format(x)+"'");
\r
428 * パラメータ名での設定(java.math.BigDecimal)。
\r
432 * @throws SQLException
\r
434 public void setBigDecimal(String key, BigDecimal x) throws SQLException {
\r
435 List<Integer> paramNums = paramMap.get(key);
\r
436 if (paramNums == null) {
\r
437 throw new SQLException("No such key [" + key + "]");
\r
439 for (int i = 0; i < paramNums.size(); i++) {
\r
440 Integer num = paramNums.get(i);
\r
441 st.setBigDecimal(num.intValue(), x);
\r
446 logParam(":"+key, "NULL");
\r
448 logParam(":"+key, x.toString());
\r
453 * パラメータ名での設定(java.sql.Blob)。
\r
456 * @throws SQLException
\r
458 public void setBlob(String key, Blob x) throws SQLException {
\r
459 List<Integer> paramNums = paramMap.get(key);
\r
460 if (paramNums == null) {
\r
461 throw new SQLException("No such key [" + key + "]");
\r
463 for (int i = 0; i < paramNums.size(); i++) {
\r
464 Integer num = paramNums.get(i);
\r
465 st.setBlob(num.intValue(), x);
\r
470 logParam(":"+key, "NULL");
\r
472 logParam(":"+key, "'"+x+"'");
\r
477 * パラメータ名での設定(java.lang.Object)。
\r
480 * @throws SQLException
\r
482 public void setObject(String key, Object x) throws SQLException {
\r
483 List<Integer> paramNums = paramMap.get(key);
\r
484 if (paramNums == null) {
\r
485 throw new SQLException("No such key [" + key + "]");
\r
487 for (int i = 0; i < paramNums.size(); i++) {
\r
488 Integer num = paramNums.get(i);
\r
489 st.setObject(num.intValue(), x);
\r
494 logParam(":"+key, "NULL");
\r
496 logParam(":"+key, "'"+x+"'");
\r
503 * @see java.sql.PreparedStatement#executeQuery()
\r
505 public ResultSet executeQuery() throws SQLException {
\r
506 logger.info(MethodUtil.getMethodName(CLASSNAME) +"\n"+sql);
\r
507 ResultSet result = st.executeQuery();
\r
514 * @see java.sql.PreparedStatement#executeUpdate()
\r
516 public int executeUpdate() throws SQLException {
\r
517 logger.info(MethodUtil.getMethodName(CLASSNAME) +"\n"+sql);
\r
518 int result = st.executeUpdate();
\r
525 * @see java.sql.PreparedStatement#execute()
\r
527 public boolean execute() throws SQLException {
\r
528 logger.info(MethodUtil.getMethodName(CLASSNAME) +"\n"+sql);
\r
529 boolean result = st.execute();
\r
534 * ------------------------------------------------------ PreaparedStatement
\r
535 * ------------------------------------------------------
\r
541 * @see java.sql.PreparedStatement#addBatch()
\r
543 public void addBatch() throws SQLException {
\r
550 * @see java.sql.PreparedStatement#clearParameters()
\r
552 public void clearParameters() throws SQLException {
\r
553 st.clearParameters();
\r
560 * @see java.sql.PreparedStatement#setByte(int, byte)
\r
562 public void setByte(int parameterIndex, byte x) throws SQLException {
\r
563 st.setByte(parameterIndex, x);
\r
569 * @see java.sql.PreparedStatement#setDouble(int, double)
\r
571 public void setDouble(int parameterIndex, double x) throws SQLException {
\r
572 st.setDouble(parameterIndex, x);
\r
578 * @see java.sql.PreparedStatement#setFloat(int, float)
\r
580 public void setFloat(int parameterIndex, float x) throws SQLException {
\r
581 st.setFloat(parameterIndex, x);
\r
587 * @see java.sql.PreparedStatement#setInt(int, int)
\r
589 public void setInt(int parameterIndex, int x) throws SQLException {
\r
590 st.setInt(parameterIndex, x);
\r
596 * @see java.sql.PreparedStatement#setNull(int, int)
\r
598 public void setNull(int parameterIndex, int sqlType) throws SQLException {
\r
599 st.setNull(parameterIndex, sqlType);
\r
605 * @see java.sql.PreparedStatement#setLong(int, long)
\r
607 public void setLong(int parameterIndex, long x) throws SQLException {
\r
608 st.setLong(parameterIndex, x);
\r
614 * @see java.sql.PreparedStatement#setShort(int, short)
\r
616 public void setShort(int parameterIndex, short x) throws SQLException {
\r
617 st.setShort(parameterIndex, x);
\r
623 * @see java.sql.PreparedStatement#setBoolean(int, boolean)
\r
625 public void setBoolean(int parameterIndex, boolean x) throws SQLException {
\r
626 st.setBoolean(parameterIndex, x);
\r
632 * @see java.sql.PreparedStatement#setBytes(int, byte[])
\r
634 public void setBytes(int parameterIndex, byte[] x) throws SQLException {
\r
635 st.setBytes(parameterIndex, x);
\r
641 * @see java.sql.PreparedStatement#setAsciiStream(int, java.io.InputStream,
\r
644 public void setAsciiStream(int parameterIndex, InputStream x, int length)
\r
645 throws SQLException {
\r
646 st.setAsciiStream(parameterIndex, x, length);
\r
652 * @see java.sql.PreparedStatement#setBinaryStream(int, java.io.InputStream,
\r
655 public void setBinaryStream(int parameterIndex, InputStream x, int length)
\r
656 throws SQLException {
\r
657 st.setBinaryStream(parameterIndex, x, length);
\r
661 * @see java.sql.PreparedStatement#setUnicodeStream(int,
\r
662 * java.io.InputStream, int)
\r
665 public void setUnicodeStream(int parameterIndex, InputStream x, int length)
\r
666 throws SQLException {
\r
667 st.setUnicodeStream(parameterIndex, x, length);
\r
673 * @see java.sql.PreparedStatement#setCharacterStream(int, java.io.Reader,
\r
676 public void setCharacterStream(int parameterIndex, Reader reader, int length)
\r
677 throws SQLException {
\r
678 st.setCharacterStream(parameterIndex, reader, length);
\r
684 * @see java.sql.PreparedStatement#setObject(int, java.lang.Object)
\r
686 public void setObject(int parameterIndex, Object x) throws SQLException {
\r
687 st.setObject(parameterIndex, x);
\r
694 * @see java.sql.PreparedStatement#setObject(int, java.lang.Object, int)
\r
696 public void setObject(int parameterIndex, Object x, int targetSqlType)
\r
697 throws SQLException {
\r
698 st.setObject(parameterIndex, x, targetSqlType);
\r
704 * @see java.sql.PreparedStatement#setObject(int, java.lang.Object, int,
\r
707 public void setObject(int parameterIndex, Object x, int targetSqlType,
\r
708 int scale) throws SQLException {
\r
709 st.setObject(parameterIndex, x, targetSqlType, scale);
\r
715 * @see java.sql.PreparedStatement#setNull(int, int, java.lang.String)
\r
717 public void setNull(int paramIndex, int sqlType, String typeName)
\r
718 throws SQLException {
\r
719 st.setNull(paramIndex, sqlType, typeName);
\r
725 * @see java.sql.PreparedStatement#setString(int, java.lang.String)
\r
727 public void setString(int parameterIndex, String x) throws SQLException {
\r
728 st.setString(parameterIndex, x);
\r
734 * @see java.sql.PreparedStatement#setBigDecimal(int, java.math.BigDecimal)
\r
736 public void setBigDecimal(int parameterIndex, BigDecimal x)
\r
737 throws SQLException {
\r
738 st.setBigDecimal(parameterIndex, x);
\r
744 * @see java.sql.PreparedStatement#setURL(int, java.net.URL)
\r
746 public void setURL(int parameterIndex, URL x) throws SQLException {
\r
747 st.setURL(parameterIndex, x);
\r
753 * @see java.sql.PreparedStatement#setArray(int, java.sql.Array)
\r
755 public void setArray(int i, Array x) throws SQLException {
\r
762 * @see java.sql.PreparedStatement#setBlob(int, java.sql.Blob)
\r
764 public void setBlob(int i, Blob x) throws SQLException {
\r
771 * @see java.sql.PreparedStatement#setClob(int, java.sql.Clob)
\r
773 public void setClob(int i, Clob x) throws SQLException {
\r
780 * @see java.sql.PreparedStatement#setDate(int, java.sql.Date)
\r
782 public void setDate(int parameterIndex, Date x) throws SQLException {
\r
783 st.setDate(parameterIndex, x);
\r
789 * @see java.sql.PreparedStatement#getParameterMetaData()
\r
791 public ParameterMetaData getParameterMetaData() throws SQLException {
\r
792 return st.getParameterMetaData();
\r
798 * @see java.sql.PreparedStatement#setRef(int, java.sql.Ref)
\r
800 public void setRef(int i, Ref x) throws SQLException {
\r
807 * @see java.sql.PreparedStatement#getMetaData()
\r
809 public ResultSetMetaData getMetaData() throws SQLException {
\r
810 return st.getMetaData();
\r
816 * @see java.sql.PreparedStatement#setTime(int, java.sql.Time)
\r
818 public void setTime(int parameterIndex, Time x) throws SQLException {
\r
819 st.setTime(parameterIndex, x);
\r
825 * @see java.sql.PreparedStatement#setTimestamp(int, java.sql.Timestamp)
\r
827 public void setTimestamp(int parameterIndex, Timestamp x)
\r
828 throws SQLException {
\r
829 st.setTimestamp(parameterIndex, x);
\r
835 * @see java.sql.PreparedStatement#setDate(int, java.sql.Date,
\r
836 * java.util.Calendar)
\r
838 public void setDate(int parameterIndex, Date x, Calendar cal)
\r
839 throws SQLException {
\r
840 st.setDate(parameterIndex, x);
\r
846 * @see java.sql.PreparedStatement#setTime(int, java.sql.Time,
\r
847 * java.util.Calendar)
\r
849 public void setTime(int parameterIndex, Time x, Calendar cal)
\r
850 throws SQLException {
\r
851 st.setTime(parameterIndex, x, cal);
\r
857 * @see java.sql.PreparedStatement#setTimestamp(int, java.sql.Timestamp,
\r
858 * java.util.Calendar)
\r
860 public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal)
\r
861 throws SQLException {
\r
862 st.setTimestamp(parameterIndex, x, cal);
\r
866 * @param parameterIndex
\r
869 * @throws SQLException
\r
870 * @see java.sql.PreparedStatement#setAsciiStream(int, java.io.InputStream, long)
\r
872 public void setAsciiStream(int parameterIndex, InputStream x, long length)
\r
873 throws SQLException {
\r
874 st.setAsciiStream(parameterIndex, x, length);
\r
878 * @param parameterIndex
\r
880 * @throws SQLException
\r
881 * @see java.sql.PreparedStatement#setAsciiStream(int, java.io.InputStream)
\r
883 public void setAsciiStream(int parameterIndex, InputStream x)
\r
884 throws SQLException {
\r
885 st.setAsciiStream(parameterIndex, x);
\r
889 * @param parameterIndex
\r
892 * @throws SQLException
\r
893 * @see java.sql.PreparedStatement#setBinaryStream(int, java.io.InputStream, long)
\r
895 public void setBinaryStream(int parameterIndex, InputStream x, long length)
\r
896 throws SQLException {
\r
897 st.setBinaryStream(parameterIndex, x, length);
\r
901 * @param parameterIndex
\r
903 * @throws SQLException
\r
904 * @see java.sql.PreparedStatement#setBinaryStream(int, java.io.InputStream)
\r
906 public void setBinaryStream(int parameterIndex, InputStream x)
\r
907 throws SQLException {
\r
908 st.setBinaryStream(parameterIndex, x);
\r
912 * @param parameterIndex
\r
913 * @param inputStream
\r
915 * @throws SQLException
\r
916 * @see java.sql.PreparedStatement#setBlob(int, java.io.InputStream, long)
\r
918 public void setBlob(int parameterIndex, InputStream inputStream, long length)
\r
919 throws SQLException {
\r
920 st.setBlob(parameterIndex, inputStream, length);
\r
924 * @param parameterIndex
\r
925 * @param inputStream
\r
926 * @throws SQLException
\r
927 * @see java.sql.PreparedStatement#setBlob(int, java.io.InputStream)
\r
929 public void setBlob(int parameterIndex, InputStream inputStream)
\r
930 throws SQLException {
\r
931 st.setBlob(parameterIndex, inputStream);
\r
935 * @param parameterIndex
\r
938 * @throws SQLException
\r
939 * @see java.sql.PreparedStatement#setCharacterStream(int, java.io.Reader, long)
\r
941 public void setCharacterStream(int parameterIndex, Reader reader,
\r
942 long length) throws SQLException {
\r
943 st.setCharacterStream(parameterIndex, reader, length);
\r
947 * @param parameterIndex
\r
949 * @throws SQLException
\r
950 * @see java.sql.PreparedStatement#setCharacterStream(int, java.io.Reader)
\r
952 public void setCharacterStream(int parameterIndex, Reader reader)
\r
953 throws SQLException {
\r
954 st.setCharacterStream(parameterIndex, reader);
\r
958 * @param parameterIndex
\r
961 * @throws SQLException
\r
962 * @see java.sql.PreparedStatement#setClob(int, java.io.Reader, long)
\r
964 public void setClob(int parameterIndex, Reader reader, long length)
\r
965 throws SQLException {
\r
966 st.setClob(parameterIndex, reader, length);
\r
970 * @param parameterIndex
\r
972 * @throws SQLException
\r
973 * @see java.sql.PreparedStatement#setClob(int, java.io.Reader)
\r
975 public void setClob(int parameterIndex, Reader reader) throws SQLException {
\r
976 st.setClob(parameterIndex, reader);
\r
980 * @param parameterIndex
\r
983 * @throws SQLException
\r
984 * @see java.sql.PreparedStatement#setNCharacterStream(int, java.io.Reader, long)
\r
986 public void setNCharacterStream(int parameterIndex, Reader value,
\r
987 long length) throws SQLException {
\r
988 st.setNCharacterStream(parameterIndex, value, length);
\r
992 * @param parameterIndex
\r
994 * @throws SQLException
\r
995 * @see java.sql.PreparedStatement#setNCharacterStream(int, java.io.Reader)
\r
997 public void setNCharacterStream(int parameterIndex, Reader value)
\r
998 throws SQLException {
\r
999 st.setNCharacterStream(parameterIndex, value);
\r
1003 * @param parameterIndex
\r
1005 * @throws SQLException
\r
1006 * @see java.sql.PreparedStatement#setNClob(int, java.sql.NClob)
\r
1008 public void setNClob(int parameterIndex, NClob value) throws SQLException {
\r
1009 st.setNClob(parameterIndex, value);
\r
1013 * @param parameterIndex
\r
1016 * @throws SQLException
\r
1017 * @see java.sql.PreparedStatement#setNClob(int, java.io.Reader, long)
\r
1019 public void setNClob(int parameterIndex, Reader reader, long length)
\r
1020 throws SQLException {
\r
1021 st.setNClob(parameterIndex, reader, length);
\r
1025 * @param parameterIndex
\r
1027 * @throws SQLException
\r
1028 * @see java.sql.PreparedStatement#setNClob(int, java.io.Reader)
\r
1030 public void setNClob(int parameterIndex, Reader reader) throws SQLException {
\r
1031 st.setNClob(parameterIndex, reader);
\r
1035 * @param parameterIndex
\r
1037 * @throws SQLException
\r
1038 * @see java.sql.PreparedStatement#setNString(int, java.lang.String)
\r
1040 public void setNString(int parameterIndex, String value)
\r
1041 throws SQLException {
\r
1042 st.setNString(parameterIndex, value);
\r
1046 * @param parameterIndex
\r
1048 * @throws SQLException
\r
1049 * @see java.sql.PreparedStatement#setRowId(int, java.sql.RowId)
\r
1051 public void setRowId(int parameterIndex, RowId x) throws SQLException {
\r
1052 st.setRowId(parameterIndex, x);
\r
1056 * @param parameterIndex
\r
1057 * @param xmlObject
\r
1058 * @throws SQLException
\r
1059 * @see java.sql.PreparedStatement#setSQLXML(int, java.sql.SQLXML)
\r
1061 public void setSQLXML(int parameterIndex, SQLXML xmlObject)
\r
1062 throws SQLException {
\r
1063 st.setSQLXML(parameterIndex, xmlObject);
\r
1069 * @throws SQLException
\r
1070 * @see java.sql.Wrapper#isWrapperFor(java.lang.Class)
\r
1073 public boolean isWrapperFor(Class<?> iface) throws SQLException {
\r
1074 return st.isWrapperFor(iface);
\r
1081 * @throws SQLException
\r
1082 * @see java.sql.Wrapper#unwrap(java.lang.Class)
\r
1085 @SuppressWarnings("unchecked")
\r
1086 public <T> T unwrap(Class<T> iface) throws SQLException {
\r