OmniSciDB  17c254d2f8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OmniSciPreparedStatement.java
Go to the documentation of this file.
1 /*
2  * Copyright 2017 MapD Technologies, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package com.omnisci.jdbc;
17 
18 import com.omnisci.thrift.server.OmniSci;
19 import com.omnisci.thrift.server.TColumnType;
20 import com.omnisci.thrift.server.TOmniSciException;
21 import com.omnisci.thrift.server.TStringRow;
22 import com.omnisci.thrift.server.TStringValue;
23 import com.omnisci.thrift.server.TTableDetails;
24 
25 import org.apache.thrift.TException;
26 import org.slf4j.Logger;
27 import org.slf4j.LoggerFactory;
28 
29 import java.io.InputStream;
30 import java.io.Reader;
31 import java.math.BigDecimal;
32 import java.net.URL;
33 import java.sql.Array;
34 import java.sql.Blob;
35 import java.sql.Clob;
36 import java.sql.Connection;
37 import java.sql.Date;
38 import java.sql.NClob;
39 import java.sql.ParameterMetaData;
40 import java.sql.PreparedStatement;
41 import java.sql.Ref;
42 import java.sql.ResultSet;
43 import java.sql.ResultSetMetaData;
44 import java.sql.RowId;
45 import java.sql.SQLException;
46 import java.sql.SQLWarning;
47 import java.sql.SQLXML;
48 import java.sql.Time;
49 import java.sql.Timestamp;
50 import java.sql.Types;
51 import java.util.ArrayList;
52 import java.util.Arrays;
53 import java.util.Calendar;
54 import java.util.List;
55 import java.util.regex.Matcher;
56 import java.util.regex.Pattern;
57 
62 class OmniSciPreparedStatement implements PreparedStatement {
63  final static Logger MAPDLOGGER =
64  LoggerFactory.getLogger(OmniSciPreparedStatement.class);
65  public SQLWarning rootWarning = null;
66 
67  private String currentSQL;
68  private String insertTableName;
69  private int parmCount = 0;
70  private String brokenSQL[];
71  private String parmRep[];
72  private boolean parmIsNull[];
73  private int fieldsOrder[];
74  private int repCount;
75  private String session;
76  private OmniSci.Client client;
77  private OmniSciStatement stmt = null;
78  private boolean isInsert = false;
79  private boolean isNewBatch = true;
80  private boolean[] parmIsString = null;
81  private List<TStringRow> rows = null;
82  private static final Pattern REGEX_PATTERN = Pattern.compile("(?i)\\s+INTO\\s+(\\w+)");
83  private static final Pattern REGEX_LOF_PATTERN = Pattern.compile(
84  "(?i)\\s*insert\\s+into\\s+[\\w:\\.]+\\s*\\(([\\w:\\s:\\,:\\']+)\\)[\\w:\\s]+\\(");
85  // this regex ignores all multi- and single-line comments and whitespaces at the
86  // beginning of a query and checks if the first meaningful word is SELECT
87  private static final Pattern REGEX_IS_SELECT_PATTERN =
88  Pattern.compile("^(?:\\s|--.*?\\R|/\\*[\\S\\s]*?\\*/|\\s*)*\\s*select[\\S\\s]*",
89  Pattern.CASE_INSENSITIVE | Pattern.MULTILINE);
90 
91  OmniSciPreparedStatement(String sql, String session, OmniSci.Client client) {
92  MAPDLOGGER.debug("Entered");
93  currentSQL = sql;
94  this.client = client;
95  this.session = session;
96  this.stmt = new OmniSciStatement(session, client);
97  MAPDLOGGER.debug("Prepared statement is " + currentSQL);
98  // TODO in real life this needs to check if the ? is inside quotes before we assume it
99  // a parameter
100  brokenSQL = currentSQL.split("\\?", -1);
101  parmCount = brokenSQL.length - 1;
102  parmRep = new String[parmCount];
103  parmIsNull = new boolean[parmCount];
104  parmIsString = new boolean[parmCount];
105  repCount = 0;
106  if (currentSQL.toUpperCase().contains("INSERT ")) {
107  // remove double quotes required for queries generated with " around all names like
108  // kafka connect
109  currentSQL = currentSQL.replaceAll("\"", " ");
110  MAPDLOGGER.debug("Insert Prepared statement is " + currentSQL);
111  isInsert = true;
112  Matcher matcher = REGEX_PATTERN.matcher(currentSQL);
113  while (matcher.find()) {
114  insertTableName = matcher.group(1);
115  MAPDLOGGER.debug("Table name for insert is '" + insertTableName + "'");
116  }
117  }
118  }
119 
120  private String getQuery() {
121  String qsql;
122  // put string together if required
123  if (parmCount > 0) {
124  if (repCount != parmCount) {
125  throw new UnsupportedOperationException(
126  "Incorrect number of replace parameters for prepared statement "
127  + currentSQL + " has only " + repCount + " parameters");
128  }
129  StringBuilder modQuery = new StringBuilder(currentSQL.length() * 5);
130  for (int i = 0; i < repCount; i++) {
131  modQuery.append(brokenSQL[i]);
132  if (parmIsNull[i]) {
133  modQuery.append("NULL");
134  } else {
135  if (parmIsString[i]) {
136  modQuery.append("'").append(parmRep[i]).append("'");
137  } else {
138  modQuery.append(parmRep[i]);
139  }
140  }
141  }
142  modQuery.append(brokenSQL[parmCount]);
143  qsql = modQuery.toString();
144  } else {
145  qsql = currentSQL;
146  }
147 
148  qsql = qsql.replace(" WHERE 1=0", " LIMIT 1 ");
149  MAPDLOGGER.debug("Query is now " + qsql);
150  repCount = 0; // reset the parameters
151  return qsql;
152  }
153 
154  private boolean isSelect() {
155  Matcher matcher = REGEX_IS_SELECT_PATTERN.matcher(currentSQL);
156  return matcher.matches();
157  }
158 
159  @Override
160  public ResultSet executeQuery() throws SQLException {
161  if (isNewBatch) {
162  String qsql = getQuery();
163  MAPDLOGGER.debug("executeQuery, sql=" + qsql);
164  return stmt.executeQuery(qsql);
165  }
166  throw new UnsupportedOperationException("Not supported yet,"
167  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
168  + " class:" + new Throwable().getStackTrace()[0].getClassName()
169  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
170  }
171 
172  @Override
173  public int executeUpdate() throws SQLException {
174  MAPDLOGGER.debug("Entered");
175  executeQuery();
176  return 1;
177  }
178 
179  @Override
180  public void setNull(int parameterIndex, int sqlType) throws SQLException {
181  MAPDLOGGER.debug("Entered");
182  parmIsNull[parameterIndex - 1] = true;
183  repCount++;
184  }
185 
186  @Override
187  public void setBoolean(int parameterIndex, boolean x) throws SQLException {
188  MAPDLOGGER.debug("Entered");
189  parmRep[parameterIndex - 1] = x ? "true" : "false";
190  parmIsString[parameterIndex - 1] = false;
191  parmIsNull[parameterIndex - 1] = false;
192  repCount++;
193  }
194 
195  @Override
196  public void setByte(int parameterIndex, byte x) throws SQLException {
197  MAPDLOGGER.debug("Entered");
198  throw new UnsupportedOperationException("Not supported yet,"
199  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
200  + " class:" + new Throwable().getStackTrace()[0].getClassName()
201  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
202  }
203 
204  @Override
205  public void setShort(int parameterIndex, short x) throws SQLException {
206  MAPDLOGGER.debug("Entered");
207  parmRep[parameterIndex - 1] = Short.toString(x);
208  parmIsNull[parameterIndex - 1] = false;
209  repCount++;
210  }
211 
212  @Override
213  public void setInt(int parameterIndex, int x) throws SQLException {
214  MAPDLOGGER.debug("Entered");
215  parmRep[parameterIndex - 1] = Integer.toString(x);
216  parmIsNull[parameterIndex - 1] = false;
217  repCount++;
218  }
219 
220  @Override
221  public void setLong(int parameterIndex, long x) throws SQLException {
222  MAPDLOGGER.debug("Entered");
223  parmRep[parameterIndex - 1] = Long.toString(x);
224  parmIsNull[parameterIndex - 1] = false;
225  repCount++;
226  }
227 
228  @Override
229  public void setFloat(int parameterIndex, float x) throws SQLException {
230  MAPDLOGGER.debug("Entered");
231  parmRep[parameterIndex - 1] = Float.toString(x);
232  parmIsNull[parameterIndex - 1] = false;
233  repCount++;
234  }
235 
236  @Override
237  public void setDouble(int parameterIndex, double x) throws SQLException {
238  MAPDLOGGER.debug("Entered");
239  parmRep[parameterIndex - 1] = Double.toString(x);
240  parmIsNull[parameterIndex - 1] = false;
241  repCount++;
242  }
243 
244  @Override
245  public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException {
246  MAPDLOGGER.debug("Entered");
247  parmRep[parameterIndex - 1] = x.toString();
248  parmIsNull[parameterIndex - 1] = false;
249  repCount++;
250  }
251 
252  @Override
253  public void setString(int parameterIndex, String x) throws SQLException {
254  MAPDLOGGER.debug("Entered");
255  // add extra ' if there are any in string
256  x = x.replaceAll("'", "''");
257  parmRep[parameterIndex - 1] = x;
258  parmIsString[parameterIndex - 1] = true;
259  parmIsNull[parameterIndex - 1] = false;
260  repCount++;
261  }
262 
263  @Override
264  public void setBytes(int parameterIndex, byte[] x) throws SQLException {
265  MAPDLOGGER.debug("Entered");
266  throw new UnsupportedOperationException("Not supported yet,"
267  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
268  + " class:" + new Throwable().getStackTrace()[0].getClassName()
269  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
270  }
271 
272  @Override
273  public void setDate(int parameterIndex, Date x) throws SQLException {
274  MAPDLOGGER.debug("Entered");
275  parmRep[parameterIndex - 1] = x.toString();
276  parmIsString[parameterIndex - 1] = true;
277  parmIsNull[parameterIndex - 1] = false;
278  repCount++;
279  }
280 
281  @Override
282  public void setTime(int parameterIndex, Time x) throws SQLException {
283  MAPDLOGGER.debug("Entered");
284  parmRep[parameterIndex - 1] = x.toString();
285  parmIsString[parameterIndex - 1] = true;
286  parmIsNull[parameterIndex - 1] = false;
287  repCount++;
288  }
289 
290  @Override
291  public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException {
292  MAPDLOGGER.debug("Entered");
293  parmRep[parameterIndex - 1] =
294  x.toString(); // new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(x);
295  parmIsString[parameterIndex - 1] = true;
296  parmIsNull[parameterIndex - 1] = false;
297  repCount++;
298  }
299 
300  @Override
301  public void setAsciiStream(int parameterIndex, InputStream x, int length)
302  throws SQLException {
303  MAPDLOGGER.debug("Entered");
304  throw new UnsupportedOperationException("Not supported yet,"
305  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
306  + " class:" + new Throwable().getStackTrace()[0].getClassName()
307  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
308  }
309 
310  @Override
311  public void setUnicodeStream(int parameterIndex, InputStream x, int length)
312  throws SQLException {
313  MAPDLOGGER.debug("Entered");
314  throw new UnsupportedOperationException("Not supported yet,"
315  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
316  + " class:" + new Throwable().getStackTrace()[0].getClassName()
317  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
318  }
319 
320  @Override
321  public void setBinaryStream(int parameterIndex, InputStream x, int length)
322  throws SQLException {
323  MAPDLOGGER.debug("Entered");
324  throw new UnsupportedOperationException("Not supported yet,"
325  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
326  + " class:" + new Throwable().getStackTrace()[0].getClassName()
327  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
328  }
329 
330  @Override
331  public void clearParameters() throws SQLException {
332  MAPDLOGGER.debug("Entered");
333  // TODO MAT we will actually need to do something here one day
334  }
335 
336  @Override
337  public void setObject(int parameterIndex, Object x, int targetSqlType)
338  throws SQLException {
339  MAPDLOGGER.debug("Entered");
340  throw new UnsupportedOperationException("Not supported yet,"
341  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
342  + " class:" + new Throwable().getStackTrace()[0].getClassName()
343  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
344  }
345 
346  @Override
347  public void setObject(int parameterIndex, Object x) throws SQLException {
348  MAPDLOGGER.debug("Entered");
349  throw new UnsupportedOperationException("Not supported yet,"
350  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
351  + " class:" + new Throwable().getStackTrace()[0].getClassName()
352  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
353  }
354 
355  @Override
356  public boolean execute() throws SQLException {
357  MAPDLOGGER.debug("Entered");
358  String tQuery = getQuery();
359  return stmt.execute(tQuery);
360  }
361 
362  @Override
363  public void addBatch() throws SQLException {
364  MAPDLOGGER.debug("Entered");
365  if (isInsert) {
366  // take the values and use stream inserter to add them
367  if (isNewBatch) {
368  // check for columns names
369  Matcher matcher = REGEX_LOF_PATTERN.matcher(currentSQL);
370  if (matcher.find()) {
371  String listOfFields[] = matcher.group(1).trim().split("\\s*,+\\s*,*\\s*");
372  if (listOfFields.length != parmCount) {
373  throw new SQLException("Too many or too few values");
374  } else if (Arrays.stream(listOfFields).distinct().toArray().length
375  != listOfFields.length) {
376  throw new SQLException("Duplicated column name");
377  }
378  fieldsOrder = new int[listOfFields.length];
379  List<String> listOfColumns = new ArrayList<String>();
380  try {
381  TTableDetails tableDetails =
382  client.get_table_details(session, insertTableName);
383  for (TColumnType column : tableDetails.row_desc) {
384  listOfColumns.add(column.col_name.toLowerCase());
385  }
386  } catch (TException ex) {
387  throw new SQLException(ex.toString());
388  }
389  for (int i = 0; i < fieldsOrder.length; i++) {
390  fieldsOrder[i] = listOfColumns.indexOf(listOfFields[i].toLowerCase());
391  if (fieldsOrder[i] == -1) {
392  throw new SQLException(
393  "Column " + listOfFields[i].toLowerCase() + " does not exist");
394  }
395  }
396  }
397 
398  rows = new ArrayList(5000);
399  isNewBatch = false;
400  }
401  // add data to stream
402  TStringRow tsr = new TStringRow();
403  for (int i = 0; i < parmCount; i++) {
404  // place string in rows array
405  TStringValue tsv = new TStringValue();
406  int colID = fieldsOrder == null ? i : fieldsOrder[i];
407  if (parmIsNull[colID]) {
408  tsv.is_null = true;
409  } else {
410  tsv.str_val = this.parmRep[colID];
411  tsv.is_null = false;
412  }
413  tsr.addToCols(tsv);
414  }
415  rows.add(tsr);
416  MAPDLOGGER.debug("addBatch, rows=" + rows.size());
417  } else {
418  throw new UnsupportedOperationException("addBatch only supported for insert, line:"
419  + new Throwable().getStackTrace()[0].getLineNumber());
420  }
421  }
422 
423  @Override
424  public void setCharacterStream(int parameterIndex, Reader reader, int length)
425  throws SQLException {
426  MAPDLOGGER.debug("Entered");
427  throw new UnsupportedOperationException("Not supported yet,"
428  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
429  + " class:" + new Throwable().getStackTrace()[0].getClassName()
430  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
431  }
432 
433  @Override
434  public void setRef(int parameterIndex, Ref x) throws SQLException {
435  MAPDLOGGER.debug("Entered");
436  throw new UnsupportedOperationException("Not supported yet,"
437  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
438  + " class:" + new Throwable().getStackTrace()[0].getClassName()
439  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
440  }
441 
442  @Override
443  public void setBlob(int parameterIndex, Blob x) throws SQLException {
444  MAPDLOGGER.debug("Entered");
445  throw new UnsupportedOperationException("Not supported yet,"
446  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
447  + " class:" + new Throwable().getStackTrace()[0].getClassName()
448  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
449  }
450 
451  @Override
452  public void setClob(int parameterIndex, Clob x) throws SQLException {
453  MAPDLOGGER.debug("Entered");
454  throw new UnsupportedOperationException("Not supported yet,"
455  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
456  + " class:" + new Throwable().getStackTrace()[0].getClassName()
457  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
458  }
459 
460  @Override
461  public void setArray(int parameterIndex, Array x) throws SQLException {
462  MAPDLOGGER.debug("Entered");
463  throw new UnsupportedOperationException("Not supported yet,"
464  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
465  + " class:" + new Throwable().getStackTrace()[0].getClassName()
466  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
467  }
468 
469  @Override
470  public ResultSetMetaData getMetaData() throws SQLException {
471  MAPDLOGGER.debug("Entered");
472  if (!isSelect()) {
473  return null;
474  }
475  if (stmt.getResultSet() != null) {
476  return stmt.getResultSet().getMetaData();
477  }
478  PreparedStatement ps = null;
479  try {
481  ps.setMaxRows(0);
482  for (int i = 1; i <= this.parmCount; ++i) {
483  ps.setNull(i, Types.NULL);
484  }
485  ResultSet rs = ps.executeQuery();
486  if (rs != null) {
487  return rs.getMetaData();
488  } else {
489  return null;
490  }
491  } finally {
492  if (ps != null) {
493  ps.close();
494  }
495  }
496  }
497 
498  @Override
499  public void setDate(int parameterIndex, Date x, Calendar cal) throws SQLException {
500  MAPDLOGGER.debug("Entered");
501  throw new UnsupportedOperationException("Not supported yet,"
502  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
503  + " class:" + new Throwable().getStackTrace()[0].getClassName()
504  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
505  }
506 
507  @Override
508  public void setTime(int parameterIndex, Time x, Calendar cal) throws SQLException {
509  MAPDLOGGER.debug("Entered");
510  throw new UnsupportedOperationException("Not supported yet,"
511  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
512  + " class:" + new Throwable().getStackTrace()[0].getClassName()
513  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
514  }
515 
516  @Override
517  public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal)
518  throws SQLException {
519  MAPDLOGGER.debug("Entered");
520  throw new UnsupportedOperationException("Not supported yet,"
521  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
522  + " class:" + new Throwable().getStackTrace()[0].getClassName()
523  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
524  }
525 
526  @Override
527  public void setNull(int parameterIndex, int sqlType, String typeName)
528  throws SQLException {
529  MAPDLOGGER.debug("Entered");
530  throw new UnsupportedOperationException("Not supported yet,"
531  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
532  + " class:" + new Throwable().getStackTrace()[0].getClassName()
533  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
534  }
535 
536  @Override
537  public void setURL(int parameterIndex, URL x) throws SQLException {
538  MAPDLOGGER.debug("Entered");
539  throw new UnsupportedOperationException("Not supported yet,"
540  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
541  + " class:" + new Throwable().getStackTrace()[0].getClassName()
542  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
543  }
544 
545  @Override
546  public ParameterMetaData getParameterMetaData() throws SQLException {
547  MAPDLOGGER.debug("Entered");
548  throw new UnsupportedOperationException("Not supported yet,"
549  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
550  + " class:" + new Throwable().getStackTrace()[0].getClassName()
551  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
552  }
553 
554  @Override
555  public void setRowId(int parameterIndex, RowId x) throws SQLException {
556  MAPDLOGGER.debug("Entered");
557  throw new UnsupportedOperationException("Not supported yet,"
558  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
559  + " class:" + new Throwable().getStackTrace()[0].getClassName()
560  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
561  }
562 
563  @Override
564  public void setNString(int parameterIndex, String value) throws SQLException {
565  MAPDLOGGER.debug("Entered");
566  throw new UnsupportedOperationException("Not supported yet,"
567  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
568  + " class:" + new Throwable().getStackTrace()[0].getClassName()
569  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
570  }
571 
572  @Override
573  public void setNCharacterStream(int parameterIndex, Reader value, long length)
574  throws SQLException {
575  MAPDLOGGER.debug("Entered");
576  throw new UnsupportedOperationException("Not supported yet,"
577  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
578  + " class:" + new Throwable().getStackTrace()[0].getClassName()
579  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
580  }
581 
582  @Override
583  public void setNClob(int parameterIndex, NClob value) throws SQLException {
584  MAPDLOGGER.debug("Entered");
585  throw new UnsupportedOperationException("Not supported yet,"
586  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
587  + " class:" + new Throwable().getStackTrace()[0].getClassName()
588  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
589  }
590 
591  @Override
592  public void setClob(int parameterIndex, Reader reader, long length)
593  throws SQLException {
594  MAPDLOGGER.debug("Entered");
595  throw new UnsupportedOperationException("Not supported yet,"
596  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
597  + " class:" + new Throwable().getStackTrace()[0].getClassName()
598  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
599  }
600 
601  @Override
602  public void setBlob(int parameterIndex, InputStream inputStream, long length)
603  throws SQLException {
604  MAPDLOGGER.debug("Entered");
605  throw new UnsupportedOperationException("Not supported yet,"
606  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
607  + " class:" + new Throwable().getStackTrace()[0].getClassName()
608  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
609  }
610 
611  @Override
612  public void setNClob(int parameterIndex, Reader reader, long length)
613  throws SQLException {
614  MAPDLOGGER.debug("Entered");
615  throw new UnsupportedOperationException("Not supported yet,"
616  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
617  + " class:" + new Throwable().getStackTrace()[0].getClassName()
618  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
619  }
620 
621  @Override
622  public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException {
623  MAPDLOGGER.debug("Entered");
624  throw new UnsupportedOperationException("Not supported yet,"
625  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
626  + " class:" + new Throwable().getStackTrace()[0].getClassName()
627  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
628  }
629 
630  @Override
631  public void setObject(
632  int parameterIndex, Object x, int targetSqlType, int scaleOrLength)
633  throws SQLException {
634  MAPDLOGGER.debug("Entered");
635  throw new UnsupportedOperationException("Not supported yet,"
636  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
637  + " class:" + new Throwable().getStackTrace()[0].getClassName()
638  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
639  }
640 
641  @Override
642  public void setAsciiStream(int parameterIndex, InputStream x, long length)
643  throws SQLException {
644  MAPDLOGGER.debug("Entered");
645  throw new UnsupportedOperationException("Not supported yet,"
646  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
647  + " class:" + new Throwable().getStackTrace()[0].getClassName()
648  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
649  }
650 
651  @Override
652  public void setBinaryStream(int parameterIndex, InputStream x, long length)
653  throws SQLException {
654  MAPDLOGGER.debug("Entered");
655  throw new UnsupportedOperationException("Not supported yet,"
656  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
657  + " class:" + new Throwable().getStackTrace()[0].getClassName()
658  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
659  }
660 
661  @Override
662  public void setCharacterStream(int parameterIndex, Reader reader, long length)
663  throws SQLException {
664  MAPDLOGGER.debug("Entered");
665  throw new UnsupportedOperationException("Not supported yet,"
666  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
667  + " class:" + new Throwable().getStackTrace()[0].getClassName()
668  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
669  }
670 
671  @Override
672  public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException {
673  MAPDLOGGER.debug("Entered");
674  throw new UnsupportedOperationException("Not supported yet,"
675  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
676  + " class:" + new Throwable().getStackTrace()[0].getClassName()
677  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
678  }
679 
680  @Override
681  public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException {
682  MAPDLOGGER.debug("Entered");
683  throw new UnsupportedOperationException("Not supported yet,"
684  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
685  + " class:" + new Throwable().getStackTrace()[0].getClassName()
686  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
687  }
688 
689  @Override
690  public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException {
691  MAPDLOGGER.debug("Entered");
692  throw new UnsupportedOperationException("Not supported yet,"
693  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
694  + " class:" + new Throwable().getStackTrace()[0].getClassName()
695  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
696  }
697 
698  @Override
699  public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException {
700  MAPDLOGGER.debug("Entered");
701  throw new UnsupportedOperationException("Not supported yet,"
702  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
703  + " class:" + new Throwable().getStackTrace()[0].getClassName()
704  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
705  }
706 
707  @Override
708  public void setClob(int parameterIndex, Reader reader) throws SQLException {
709  MAPDLOGGER.debug("Entered");
710  throw new UnsupportedOperationException("Not supported yet,"
711  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
712  + " class:" + new Throwable().getStackTrace()[0].getClassName()
713  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
714  }
715 
716  @Override
717  public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException {
718  MAPDLOGGER.debug("Entered");
719  throw new UnsupportedOperationException("Not supported yet,"
720  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
721  + " class:" + new Throwable().getStackTrace()[0].getClassName()
722  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
723  }
724 
725  @Override
726  public void setNClob(int parameterIndex, Reader reader) throws SQLException {
727  MAPDLOGGER.debug("Entered");
728  throw new UnsupportedOperationException("Not supported yet,"
729  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
730  + " class:" + new Throwable().getStackTrace()[0].getClassName()
731  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
732  }
733 
734  @Override
735  public ResultSet executeQuery(String sql) throws SQLException {
736  MAPDLOGGER.debug("Entered");
737  throw new UnsupportedOperationException("Not supported yet,"
738  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
739  + " class:" + new Throwable().getStackTrace()[0].getClassName()
740  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
741  }
742 
743  @Override
744  public int executeUpdate(String sql) throws SQLException {
745  MAPDLOGGER.debug("Entered");
746  throw new UnsupportedOperationException("Not supported yet,"
747  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
748  + " class:" + new Throwable().getStackTrace()[0].getClassName()
749  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
750  }
751 
752  @Override
753  public void close() throws SQLException {
754  MAPDLOGGER.debug("close");
755  if (stmt != null) {
756  // TODO MAT probably more needed here
757  stmt.close();
758  stmt = null;
759  }
760  }
761 
762  @Override
763  public int getMaxFieldSize() throws SQLException {
764  MAPDLOGGER.debug("Entered");
765  throw new UnsupportedOperationException("Not supported yet,"
766  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
767  + " class:" + new Throwable().getStackTrace()[0].getClassName()
768  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
769  }
770 
771  @Override
772  public void setMaxFieldSize(int max) throws SQLException {
773  MAPDLOGGER.debug("Entered");
774  throw new UnsupportedOperationException("Not supported yet,"
775  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
776  + " class:" + new Throwable().getStackTrace()[0].getClassName()
777  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
778  }
779 
780  @Override
781  public int getMaxRows() throws SQLException {
782  MAPDLOGGER.debug("Entered");
783  return stmt.getMaxRows();
784  }
785 
786  @Override
787  public void setMaxRows(int max) throws SQLException {
788  MAPDLOGGER.debug("Entered");
789  MAPDLOGGER.debug("SetMaxRows to " + max);
790  stmt.setMaxRows(max);
791  }
792 
793  @Override
794  public void setEscapeProcessing(boolean enable) throws SQLException {
795  MAPDLOGGER.debug("Entered");
796  throw new UnsupportedOperationException("Not supported yet,"
797  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
798  + " class:" + new Throwable().getStackTrace()[0].getClassName()
799  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
800  }
801 
802  @Override
803  public int getQueryTimeout() throws SQLException {
804  MAPDLOGGER.debug("Entered");
805  return 0;
806  }
807 
808  @Override
809  public void setQueryTimeout(int seconds) throws SQLException {
810  MAPDLOGGER.debug("Entered");
811  SQLWarning warning = new SQLWarning(
812  "Query timeouts are not supported. Substituting a value of zero.");
813  if (rootWarning == null)
814  rootWarning = warning;
815  else
816  rootWarning.setNextWarning(warning);
817  }
818 
819  @Override
820  public void cancel() throws SQLException {
821  MAPDLOGGER.debug("Entered");
822  throw new UnsupportedOperationException("Not supported yet,"
823  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
824  + " class:" + new Throwable().getStackTrace()[0].getClassName()
825  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
826  }
827 
828  @Override
829  public SQLWarning getWarnings() throws SQLException {
830  MAPDLOGGER.debug("Entered");
831  return rootWarning;
832  }
833 
834  @Override
835  public void clearWarnings() throws SQLException {
836  MAPDLOGGER.debug("Entered");
837  rootWarning = null;
838  }
839 
840  @Override
841  public void setCursorName(String name) throws SQLException {
842  MAPDLOGGER.debug("Entered");
843  throw new UnsupportedOperationException("Not supported yet,"
844  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
845  + " class:" + new Throwable().getStackTrace()[0].getClassName()
846  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
847  }
848 
849  @Override
850  public boolean execute(String sql) throws SQLException {
851  MAPDLOGGER.debug("Entered");
852  throw new UnsupportedOperationException("Not supported yet,"
853  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
854  + " class:" + new Throwable().getStackTrace()[0].getClassName()
855  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
856  }
857 
858  @Override
859  public ResultSet getResultSet() throws SQLException {
860  MAPDLOGGER.debug("Entered");
861  return stmt.getResultSet();
862  }
863 
864  @Override
865  public int getUpdateCount() throws SQLException {
866  MAPDLOGGER.debug("Entered");
867  // TODO MAT this needs to change when updates are added
868  return 0;
869  }
870 
871  @Override
872  public boolean getMoreResults() throws SQLException {
873  MAPDLOGGER.debug("Entered");
874  return stmt.getMoreResults();
875  }
876 
877  @Override
878  public void setFetchDirection(int direction) throws SQLException {
879  MAPDLOGGER.debug("Entered");
880  throw new UnsupportedOperationException("Not supported yet,"
881  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
882  + " class:" + new Throwable().getStackTrace()[0].getClassName()
883  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
884  }
885 
886  @Override
887  public int getFetchDirection() throws SQLException {
888  MAPDLOGGER.debug("Entered");
889  throw new UnsupportedOperationException("Not supported yet,"
890  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
891  + " class:" + new Throwable().getStackTrace()[0].getClassName()
892  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
893  }
894 
895  @Override
896  public void setFetchSize(int rows) throws SQLException {
897  MAPDLOGGER.debug("Entered");
898  // TODO we need to chnage the model to allow smaller select chunks at the moment you
899  // get everything
900  }
901 
902  @Override
903  public int getFetchSize() throws SQLException {
904  MAPDLOGGER.debug("Entered");
905  throw new UnsupportedOperationException("Not supported yet,"
906  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
907  + " class:" + new Throwable().getStackTrace()[0].getClassName()
908  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
909  }
910 
911  @Override
912  public int getResultSetConcurrency() throws SQLException {
913  MAPDLOGGER.debug("Entered");
914  throw new UnsupportedOperationException("Not supported yet,"
915  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
916  + " class:" + new Throwable().getStackTrace()[0].getClassName()
917  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
918  }
919 
920  @Override
921  public int getResultSetType() throws SQLException {
922  MAPDLOGGER.debug("Entered");
923  throw new UnsupportedOperationException("Not supported yet,"
924  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
925  + " class:" + new Throwable().getStackTrace()[0].getClassName()
926  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
927  }
928 
929  @Override
930  public void addBatch(String sql) throws SQLException {
931  MAPDLOGGER.debug("Entered");
932  throw new UnsupportedOperationException("Not supported yet,"
933  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
934  + " class:" + new Throwable().getStackTrace()[0].getClassName()
935  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
936  }
937 
938  @Override
939  public void clearBatch() throws SQLException {
940  MAPDLOGGER.debug("Entered");
941  if (rows != null) {
942  rows.clear();
943  }
944  }
945 
946  @Override
947  public int[] executeBatch() throws SQLException {
948  int ret[] = null;
949  if (rows != null) {
950  MAPDLOGGER.debug("executeBatch, rows=" + rows.size());
951  try {
952  // send the batch
953  client.load_table(session, insertTableName, rows);
954  } catch (TOmniSciException ex) {
955  throw new SQLException("executeBatch failed: " + ex.getError_msg());
956  } catch (TException ex) {
957  throw new SQLException("executeBatch failed: " + ex.toString());
958  }
959  ret = new int[rows.size()];
960  for (int i = 0; i < rows.size(); i++) {
961  ret[i] = 1;
962  }
963  clearBatch();
964  }
965  return ret;
966  }
967 
968  @Override
969  public Connection getConnection() throws SQLException {
970  MAPDLOGGER.debug("Entered");
971  throw new UnsupportedOperationException("Not supported yet,"
972  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
973  + " class:" + new Throwable().getStackTrace()[0].getClassName()
974  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
975  }
976 
977  @Override
978  public boolean getMoreResults(int current) throws SQLException {
979  MAPDLOGGER.debug("Entered");
980  throw new UnsupportedOperationException("Not supported yet,"
981  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
982  + " class:" + new Throwable().getStackTrace()[0].getClassName()
983  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
984  }
985 
986  @Override
987  public ResultSet getGeneratedKeys() throws SQLException {
988  MAPDLOGGER.debug("Entered");
989  throw new UnsupportedOperationException("Not supported yet,"
990  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
991  + " class:" + new Throwable().getStackTrace()[0].getClassName()
992  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
993  }
994 
995  @Override
996  public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException {
997  MAPDLOGGER.debug("Entered");
998  throw new UnsupportedOperationException("Not supported yet,"
999  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
1000  + " class:" + new Throwable().getStackTrace()[0].getClassName()
1001  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
1002  }
1003 
1004  @Override
1005  public int executeUpdate(String sql, int[] columnIndexes) throws SQLException {
1006  MAPDLOGGER.debug("Entered");
1007  throw new UnsupportedOperationException("Not supported yet,"
1008  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
1009  + " class:" + new Throwable().getStackTrace()[0].getClassName()
1010  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
1011  }
1012 
1013  @Override
1014  public int executeUpdate(String sql, String[] columnNames) throws SQLException {
1015  MAPDLOGGER.debug("Entered");
1016  throw new UnsupportedOperationException("Not supported yet,"
1017  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
1018  + " class:" + new Throwable().getStackTrace()[0].getClassName()
1019  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
1020  }
1021 
1022  @Override
1023  public boolean execute(String sql, int autoGeneratedKeys) throws SQLException {
1024  MAPDLOGGER.debug("Entered");
1025  throw new UnsupportedOperationException("Not supported yet,"
1026  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
1027  + " class:" + new Throwable().getStackTrace()[0].getClassName()
1028  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
1029  }
1030 
1031  @Override
1032  public boolean execute(String sql, int[] columnIndexes) throws SQLException {
1033  MAPDLOGGER.debug("Entered");
1034  throw new UnsupportedOperationException("Not supported yet,"
1035  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
1036  + " class:" + new Throwable().getStackTrace()[0].getClassName()
1037  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
1038  }
1039 
1040  @Override
1041  public boolean execute(String sql, String[] columnNames) throws SQLException {
1042  MAPDLOGGER.debug("Entered");
1043  throw new UnsupportedOperationException("Not supported yet,"
1044  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
1045  + " class:" + new Throwable().getStackTrace()[0].getClassName()
1046  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
1047  }
1048 
1049  @Override
1050  public int getResultSetHoldability() throws SQLException {
1051  MAPDLOGGER.debug("Entered");
1052  throw new UnsupportedOperationException("Not supported yet,"
1053  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
1054  + " class:" + new Throwable().getStackTrace()[0].getClassName()
1055  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
1056  }
1057 
1058  @Override
1059  public boolean isClosed() throws SQLException {
1060  MAPDLOGGER.debug("Entered");
1061  throw new UnsupportedOperationException("Not supported yet,"
1062  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
1063  + " class:" + new Throwable().getStackTrace()[0].getClassName()
1064  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
1065  }
1066 
1067  @Override
1068  public void setPoolable(boolean poolable) throws SQLException {
1069  MAPDLOGGER.debug("Entered");
1070  throw new UnsupportedOperationException("Not supported yet,"
1071  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
1072  + " class:" + new Throwable().getStackTrace()[0].getClassName()
1073  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
1074  }
1075 
1076  @Override
1077  public boolean isPoolable() throws SQLException {
1078  MAPDLOGGER.debug("Entered");
1079  throw new UnsupportedOperationException("Not supported yet,"
1080  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
1081  + " class:" + new Throwable().getStackTrace()[0].getClassName()
1082  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
1083  }
1084 
1085  @Override
1086  public void closeOnCompletion() throws SQLException {
1087  MAPDLOGGER.debug("Entered");
1088  throw new UnsupportedOperationException("Not supported yet,"
1089  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
1090  + " class:" + new Throwable().getStackTrace()[0].getClassName()
1091  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
1092  }
1093 
1094  @Override
1095  public boolean isCloseOnCompletion() throws SQLException {
1096  MAPDLOGGER.debug("Entered");
1097  throw new UnsupportedOperationException("Not supported yet,"
1098  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
1099  + " class:" + new Throwable().getStackTrace()[0].getClassName()
1100  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
1101  }
1102 
1103  @Override
1104  public <T> T unwrap(Class<T> iface) throws SQLException {
1105  MAPDLOGGER.debug("Entered");
1106  throw new UnsupportedOperationException("Not supported yet,"
1107  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
1108  + " class:" + new Throwable().getStackTrace()[0].getClassName()
1109  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
1110  }
1111 
1112  @Override
1113  public boolean isWrapperFor(Class<?> iface) throws SQLException {
1114  MAPDLOGGER.debug("Entered");
1115  throw new UnsupportedOperationException("Not supported yet,"
1116  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
1117  + " class:" + new Throwable().getStackTrace()[0].getClassName()
1118  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
1119  }
1120 }
void setBlob(int parameterIndex, InputStream inputStream)
void setNString(int parameterIndex, String value)
void setObject(int parameterIndex, Object x, int targetSqlType)
void setClob(int parameterIndex, Reader reader)
void setNClob(int parameterIndex, NClob value)
void setNClob(int parameterIndex, Reader reader, long length)
int executeUpdate(String sql, int autoGeneratedKeys)
void setCharacterStream(int parameterIndex, Reader reader, int length)
void setAsciiStream(int parameterIndex, InputStream x)
boolean execute(String sql, int[] columnIndexes)
void setDouble(int parameterIndex, double x)
OmniSciPreparedStatement(String sql, String session, OmniSci.Client client)
void setBinaryStream(int parameterIndex, InputStream x, long length)
boolean execute(String sql, int autoGeneratedKeys)
void setNClob(int parameterIndex, Reader reader)
int executeUpdate(String sql, String[] columnNames)
void setBinaryStream(int parameterIndex, InputStream x)
void setBinaryStream(int parameterIndex, InputStream x, int length)
void setBoolean(int parameterIndex, boolean x)
void setTimestamp(int parameterIndex, Timestamp x, Calendar cal)
size_t append(FILE *f, const size_t size, int8_t *buf)
Appends the specified number of bytes to the end of the file f from buf.
Definition: File.cpp:135
void setCharacterStream(int parameterIndex, Reader reader, long length)
void setCharacterStream(int parameterIndex, Reader reader)
void setString(int parameterIndex, String x)
void setNull(int parameterIndex, int sqlType, String typeName)
void setNCharacterStream(int parameterIndex, Reader value, long length)
void setNull(int parameterIndex, int sqlType)
void setBigDecimal(int parameterIndex, BigDecimal x)
void setTimestamp(int parameterIndex, Timestamp x)
void setSQLXML(int parameterIndex, SQLXML xmlObject)
void setDate(int parameterIndex, Date x, Calendar cal)
void setNCharacterStream(int parameterIndex, Reader value)
void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength)
int executeUpdate(String sql, int[] columnIndexes)
void setUnicodeStream(int parameterIndex, InputStream x, int length)
boolean execute(String sql, String[] columnNames)
void setAsciiStream(int parameterIndex, InputStream x, int length)
void setObject(int parameterIndex, Object x)
void setTime(int parameterIndex, Time x, Calendar cal)
void setAsciiStream(int parameterIndex, InputStream x, long length)
void setBlob(int parameterIndex, InputStream inputStream, long length)
void setClob(int parameterIndex, Reader reader, long length)