OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HeavyAIPreparedStatement.java
Go to the documentation of this file.
1 /*
2  * Copyright 2022 HEAVY.AI, 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 ai.heavy.jdbc;
17 
18 import org.apache.thrift.TException;
19 import org.slf4j.Logger;
20 import org.slf4j.LoggerFactory;
21 
22 import java.io.InputStream;
23 import java.io.Reader;
24 import java.math.BigDecimal;
25 import java.net.URL;
26 import java.sql.Array;
27 import java.sql.Blob;
28 import java.sql.Clob;
29 import java.sql.Connection;
30 import java.sql.Date;
31 import java.sql.NClob;
32 import java.sql.ParameterMetaData;
33 import java.sql.PreparedStatement;
34 import java.sql.Ref;
35 import java.sql.ResultSet;
36 import java.sql.ResultSetMetaData;
37 import java.sql.RowId;
38 import java.sql.SQLException;
39 import java.sql.SQLWarning;
40 import java.sql.SQLXML;
41 import java.sql.Time;
42 import java.sql.Timestamp;
43 import java.sql.Types;
44 import java.util.ArrayList;
45 import java.util.Arrays;
46 import java.util.Calendar;
47 import java.util.List;
48 import java.util.regex.Matcher;
49 import java.util.regex.Pattern;
50 
51 import ai.heavy.thrift.server.Heavy;
52 import ai.heavy.thrift.server.TColumnType;
53 import ai.heavy.thrift.server.TDBException;
54 import ai.heavy.thrift.server.TStringRow;
55 import ai.heavy.thrift.server.TStringValue;
56 import ai.heavy.thrift.server.TTableDetails;
57 
58 class HeavyAIPreparedStatement implements PreparedStatement {
59  final static Logger HEAVYDBLOGGER =
60  LoggerFactory.getLogger(HeavyAIPreparedStatement.class);
61  public SQLWarning rootWarning = null;
62 
63  private String currentSQL;
64  private String insertTableName;
65  private int parmCount = 0;
66  private String brokenSQL[];
67  private String parmRep[];
68  private boolean parmIsNull[];
69  private String listOfFields[];
70  private int repCount;
71  private String session;
72  private Heavy.Client client;
73  private HeavyAIStatement stmt = null;
74  private boolean isInsert = false;
75  private boolean isNewBatch = true;
76  private boolean[] parmIsString = null;
77  private List<TStringRow> rows = null;
78  private static final Pattern REGEX_PATTERN = Pattern.compile("(?i)\\s+INTO\\s+(\\w+)");
79  private static final Pattern REGEX_LOF_PATTERN = Pattern.compile(
80  "(?i)\\s*insert\\s+into\\s+[\\w:\\.]+\\s*\\(([\\w:\\s:\\,:\\']+)\\)[\\w:\\s]+\\(");
81  // this regex ignores all multi- and single-line comments and whitespaces at the
82  // beginning of a query and checks if the first meaningful word is SELECT
83  private static final Pattern REGEX_IS_SELECT_PATTERN =
84  Pattern.compile("^(?:\\s|--.*?\\R|/\\*[\\S\\s]*?\\*/|\\s*)*\\s*select[\\S\\s]*",
85  Pattern.CASE_INSENSITIVE | Pattern.MULTILINE);
86  private boolean isClosed = false;
87 
88  HeavyAIPreparedStatement(String sql, String session, HeavyAIConnection connection) {
89  HEAVYDBLOGGER.debug("Entered");
90  currentSQL = sql;
91  this.client = connection.client;
92  this.session = session;
93  this.stmt = new HeavyAIStatement(session, connection);
94  HEAVYDBLOGGER.debug("Prepared statement is " + currentSQL);
95  // TODO in real life this needs to check if the ? is inside quotes before we
96  // assume it
97  // a parameter
98  brokenSQL = currentSQL.split("\\?", -1);
99  parmCount = brokenSQL.length - 1;
100  parmRep = new String[parmCount];
101  parmIsNull = new boolean[parmCount];
102  parmIsString = new boolean[parmCount];
103  repCount = 0;
104  if (currentSQL.toUpperCase().contains("INSERT ")) {
105  // remove double quotes required for queries generated with " around all names
106  // like
107  // kafka connect
108  currentSQL = currentSQL.replaceAll("\"", " ");
109  HEAVYDBLOGGER.debug("Insert Prepared statement is " + currentSQL);
110  isInsert = true;
111  Matcher matcher = REGEX_PATTERN.matcher(currentSQL);
112  while (matcher.find()) {
113  insertTableName = matcher.group(1);
114  HEAVYDBLOGGER.debug("Table name for insert is '" + insertTableName + "'");
115  }
116  }
117  }
118 
119  private String getQuery() {
120  String qsql;
121  // put string together if required
122  if (parmCount > 0) {
123  if (repCount != parmCount) {
124  throw new UnsupportedOperationException(
125  "Incorrect number of replace parameters for prepared statement "
126  + currentSQL + " has only " + repCount + " parameters");
127  }
128  StringBuilder modQuery = new StringBuilder(currentSQL.length() * 5);
129  for (int i = 0; i < repCount; i++) {
130  modQuery.append(brokenSQL[i]);
131  if (parmIsNull[i]) {
132  modQuery.append("NULL");
133  } else {
134  if (parmIsString[i]) {
135  modQuery.append("'").append(parmRep[i]).append("'");
136  } else {
137  modQuery.append(parmRep[i]);
138  }
139  }
140  }
141  modQuery.append(brokenSQL[parmCount]);
142  qsql = modQuery.toString();
143  } else {
144  qsql = currentSQL;
145  }
146 
147  qsql = qsql.replace(" WHERE 1=0", " LIMIT 1 ");
148  HEAVYDBLOGGER.debug("Query is now " + qsql);
149  repCount = 0; // reset the parameters
150  return qsql;
151  }
152 
153  private boolean isSelect() {
154  Matcher matcher = REGEX_IS_SELECT_PATTERN.matcher(currentSQL);
155  return matcher.matches();
156  }
157 
158  @Override
159  public ResultSet executeQuery() throws SQLException {
160  if (isNewBatch) {
161  String qsql = getQuery();
162  HEAVYDBLOGGER.debug("executeQuery, sql=" + qsql);
163  return stmt.executeQuery(qsql);
164  }
165  throw new UnsupportedOperationException("Not supported yet,"
166  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
167  + " class:" + new Throwable().getStackTrace()[0].getClassName()
168  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
169  }
170 
171  @Override
172  public int executeUpdate() throws SQLException {
173  HEAVYDBLOGGER.debug("Entered");
174  executeQuery();
175  // TODO: OmniSciDB supports updates, inserts and deletes, but
176  // there is no way to get number of affected rows at the moment
177  return -1;
178  }
179 
180  @Override
181  public void setNull(int parameterIndex, int sqlType) throws SQLException {
182  HEAVYDBLOGGER.debug("Entered");
183  parmIsNull[parameterIndex - 1] = true;
184  repCount++;
185  }
186 
187  @Override
188  public void setBoolean(int parameterIndex, boolean x) throws SQLException {
189  HEAVYDBLOGGER.debug("Entered");
190  parmRep[parameterIndex - 1] = x ? "true" : "false";
191  parmIsString[parameterIndex - 1] = false;
192  parmIsNull[parameterIndex - 1] = false;
193  repCount++;
194  }
195 
196  @Override
197  public void setByte(int parameterIndex, byte x) throws SQLException {
198  HEAVYDBLOGGER.debug("Entered");
199  throw new UnsupportedOperationException("Not supported yet,"
200  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
201  + " class:" + new Throwable().getStackTrace()[0].getClassName()
202  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
203  }
204 
205  @Override
206  public void setShort(int parameterIndex, short x) throws SQLException {
207  HEAVYDBLOGGER.debug("Entered");
208  parmRep[parameterIndex - 1] = Short.toString(x);
209  parmIsNull[parameterIndex - 1] = false;
210  repCount++;
211  }
212 
213  @Override
214  public void setInt(int parameterIndex, int x) throws SQLException {
215  HEAVYDBLOGGER.debug("Entered");
216  parmRep[parameterIndex - 1] = Integer.toString(x);
217  parmIsNull[parameterIndex - 1] = false;
218  repCount++;
219  }
220 
221  @Override
222  public void setLong(int parameterIndex, long x) throws SQLException {
223  HEAVYDBLOGGER.debug("Entered");
224  parmRep[parameterIndex - 1] = Long.toString(x);
225  parmIsNull[parameterIndex - 1] = false;
226  repCount++;
227  }
228 
229  @Override
230  public void setFloat(int parameterIndex, float x) throws SQLException {
231  HEAVYDBLOGGER.debug("Entered");
232  parmRep[parameterIndex - 1] = Float.toString(x);
233  parmIsNull[parameterIndex - 1] = false;
234  repCount++;
235  }
236 
237  @Override
238  public void setDouble(int parameterIndex, double x) throws SQLException {
239  HEAVYDBLOGGER.debug("Entered");
240  parmRep[parameterIndex - 1] = Double.toString(x);
241  parmIsNull[parameterIndex - 1] = false;
242  repCount++;
243  }
244 
245  @Override
246  public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException {
247  HEAVYDBLOGGER.debug("Entered");
248  parmRep[parameterIndex - 1] = x.toString();
249  parmIsNull[parameterIndex - 1] = false;
250  repCount++;
251  }
252 
253  @Override
254  public void setString(int parameterIndex, String x) throws SQLException {
255  HEAVYDBLOGGER.debug("Entered");
256  // add extra ' if there are any in string
257  x = x.replaceAll("'", "''");
258  parmRep[parameterIndex - 1] = x;
259  parmIsString[parameterIndex - 1] = true;
260  parmIsNull[parameterIndex - 1] = false;
261  repCount++;
262  }
263 
264  @Override
265  public void setBytes(int parameterIndex, byte[] x) throws SQLException {
266  HEAVYDBLOGGER.debug("Entered");
267  throw new UnsupportedOperationException("Not supported yet,"
268  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
269  + " class:" + new Throwable().getStackTrace()[0].getClassName()
270  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
271  }
272 
273  @Override
274  public void setDate(int parameterIndex, Date x) throws SQLException {
275  HEAVYDBLOGGER.debug("Entered");
276  parmRep[parameterIndex - 1] = x.toString();
277  parmIsString[parameterIndex - 1] = true;
278  parmIsNull[parameterIndex - 1] = false;
279  repCount++;
280  }
281 
282  @Override
283  public void setTime(int parameterIndex, Time x) throws SQLException {
284  HEAVYDBLOGGER.debug("Entered");
285  parmRep[parameterIndex - 1] = x.toString();
286  parmIsString[parameterIndex - 1] = true;
287  parmIsNull[parameterIndex - 1] = false;
288  repCount++;
289  }
290 
291  @Override
292  public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException {
293  HEAVYDBLOGGER.debug("Entered");
294  parmRep[parameterIndex - 1] =
295  x.toString(); // new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(x);
296  parmIsString[parameterIndex - 1] = true;
297  parmIsNull[parameterIndex - 1] = false;
298  repCount++;
299  }
300 
301  @Override
302  public void setAsciiStream(int parameterIndex, InputStream x, int length)
303  throws SQLException {
304  HEAVYDBLOGGER.debug("Entered");
305  throw new UnsupportedOperationException("Not supported yet,"
306  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
307  + " class:" + new Throwable().getStackTrace()[0].getClassName()
308  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
309  }
310 
311  @Override
312  public void setUnicodeStream(int parameterIndex, InputStream x, int length)
313  throws SQLException {
314  HEAVYDBLOGGER.debug("Entered");
315  throw new UnsupportedOperationException("Not supported yet,"
316  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
317  + " class:" + new Throwable().getStackTrace()[0].getClassName()
318  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
319  }
320 
321  @Override
322  public void setBinaryStream(int parameterIndex, InputStream x, int length)
323  throws SQLException {
324  HEAVYDBLOGGER.debug("Entered");
325  throw new UnsupportedOperationException("Not supported yet,"
326  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
327  + " class:" + new Throwable().getStackTrace()[0].getClassName()
328  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
329  }
330 
331  @Override
332  public void clearParameters() throws SQLException {
333  HEAVYDBLOGGER.debug("Entered");
334  // TODO MAT we will actually need to do something here one day
335  }
336 
337  @Override
338  public void setObject(int parameterIndex, Object x, int targetSqlType)
339  throws SQLException {
340  HEAVYDBLOGGER.debug("Entered");
341  throw new UnsupportedOperationException("Not supported yet,"
342  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
343  + " class:" + new Throwable().getStackTrace()[0].getClassName()
344  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
345  }
346 
347  @Override
348  public void setObject(int parameterIndex, Object x) throws SQLException {
349  HEAVYDBLOGGER.debug("Entered");
350  throw new UnsupportedOperationException("Not supported yet,"
351  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
352  + " class:" + new Throwable().getStackTrace()[0].getClassName()
353  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
354  }
355 
356  @Override
357  public boolean execute() throws SQLException {
358  HEAVYDBLOGGER.debug("Entered");
359  String tQuery = getQuery();
360  return stmt.execute(tQuery);
361  }
362 
363  @Override
364  public void addBatch() throws SQLException {
365  HEAVYDBLOGGER.debug("Entered");
366  if (isInsert) {
367  // take the values and use stream inserter to add them
368  if (isNewBatch) {
369  // check for columns names
370  Matcher matcher = REGEX_LOF_PATTERN.matcher(currentSQL);
371  if (matcher.find()) {
372  listOfFields = matcher.group(1).trim().split("\\s*,+\\s*,*\\s*");
373  if (listOfFields.length != parmCount) {
374  throw new SQLException("Too many or too few values");
375  } else if (Arrays.stream(listOfFields).distinct().toArray().length
376  != listOfFields.length) {
377  throw new SQLException("Duplicated column name");
378  }
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 (String paramName : listOfFields) {
390  if (listOfColumns.indexOf(paramName) == -1) {
391  throw new SQLException(
392  "Column " + paramName.toLowerCase() + " does not exist");
393  }
394  }
395  } else {
396  listOfFields = new String[0];
397  }
398 
399  rows = new ArrayList(5000);
400  isNewBatch = false;
401  }
402  // add data to stream
403  TStringRow tsr = new TStringRow();
404  for (int i = 0; i < parmCount; i++) {
405  // place string in rows array
406  TStringValue tsv = new TStringValue();
407  if (parmIsNull[i]) {
408  tsv.is_null = true;
409  } else {
410  tsv.str_val = this.parmRep[i];
411  tsv.is_null = false;
412  }
413  tsr.addToCols(tsv);
414  }
415  rows.add(tsr);
416  HEAVYDBLOGGER.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  HEAVYDBLOGGER.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  HEAVYDBLOGGER.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  HEAVYDBLOGGER.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  HEAVYDBLOGGER.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  HEAVYDBLOGGER.debug("Entered");
463  parmRep[parameterIndex - 1] = x.toString();
464  parmIsNull[parameterIndex - 1] = false;
465  repCount++;
466  }
467 
468  @Override
469  public ResultSetMetaData getMetaData() throws SQLException {
470  HEAVYDBLOGGER.debug("Entered");
471  if (!isSelect()) {
472  return null;
473  }
474  if (stmt.getResultSet() != null) {
475  return stmt.getResultSet().getMetaData();
476  }
477  PreparedStatement ps = null;
478  try {
479  ps = new HeavyAIPreparedStatement(
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  HEAVYDBLOGGER.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  HEAVYDBLOGGER.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  HEAVYDBLOGGER.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  HEAVYDBLOGGER.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  HEAVYDBLOGGER.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  HEAVYDBLOGGER.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  HEAVYDBLOGGER.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  HEAVYDBLOGGER.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  HEAVYDBLOGGER.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  HEAVYDBLOGGER.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  HEAVYDBLOGGER.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  HEAVYDBLOGGER.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  HEAVYDBLOGGER.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  HEAVYDBLOGGER.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  HEAVYDBLOGGER.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  HEAVYDBLOGGER.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  HEAVYDBLOGGER.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  HEAVYDBLOGGER.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  HEAVYDBLOGGER.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  HEAVYDBLOGGER.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  HEAVYDBLOGGER.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  HEAVYDBLOGGER.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  HEAVYDBLOGGER.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  HEAVYDBLOGGER.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  HEAVYDBLOGGER.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  HEAVYDBLOGGER.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  HEAVYDBLOGGER.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  HEAVYDBLOGGER.debug("close");
755  if (stmt != null) {
756  // TODO MAT probably more needed here
757  stmt.close();
758  stmt = null;
759  }
760  isClosed = true;
761  }
762 
763  @Override
764  public int getMaxFieldSize() throws SQLException {
765  HEAVYDBLOGGER.debug("Entered");
766  throw new UnsupportedOperationException("Not supported yet,"
767  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
768  + " class:" + new Throwable().getStackTrace()[0].getClassName()
769  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
770  }
771 
772  @Override
773  public void setMaxFieldSize(int max) throws SQLException {
774  HEAVYDBLOGGER.debug("Entered");
775  throw new UnsupportedOperationException("Not supported yet,"
776  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
777  + " class:" + new Throwable().getStackTrace()[0].getClassName()
778  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
779  }
780 
781  @Override
782  public int getMaxRows() throws SQLException {
783  HEAVYDBLOGGER.debug("Entered");
784  return stmt.getMaxRows();
785  }
786 
787  @Override
788  public void setMaxRows(int max) throws SQLException {
789  HEAVYDBLOGGER.debug("Entered");
790  HEAVYDBLOGGER.debug("SetMaxRows to " + max);
791  stmt.setMaxRows(max);
792  }
793 
794  @Override
795  public void setEscapeProcessing(boolean enable) throws SQLException {
796  HEAVYDBLOGGER.debug("Entered");
797  throw new UnsupportedOperationException("Not supported yet,"
798  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
799  + " class:" + new Throwable().getStackTrace()[0].getClassName()
800  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
801  }
802 
803  @Override
804  public int getQueryTimeout() throws SQLException {
805  HEAVYDBLOGGER.debug("Entered");
806  return 0;
807  }
808 
809  @Override
810  public void setQueryTimeout(int seconds) throws SQLException {
811  HEAVYDBLOGGER.debug("Entered");
812  SQLWarning warning = new SQLWarning(
813  "Query timeouts are not supported. Substituting a value of zero.");
814  if (rootWarning == null)
815  rootWarning = warning;
816  else
817  rootWarning.setNextWarning(warning);
818  }
819 
820  @Override
821  public void cancel() throws SQLException {
822  HEAVYDBLOGGER.debug("Entered");
823  throw new UnsupportedOperationException("Not supported yet,"
824  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
825  + " class:" + new Throwable().getStackTrace()[0].getClassName()
826  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
827  }
828 
829  @Override
830  public SQLWarning getWarnings() throws SQLException {
831  HEAVYDBLOGGER.debug("Entered");
832  return rootWarning;
833  }
834 
835  @Override
836  public void clearWarnings() throws SQLException {
837  HEAVYDBLOGGER.debug("Entered");
838  rootWarning = null;
839  }
840 
841  @Override
842  public void setCursorName(String name) throws SQLException {
843  HEAVYDBLOGGER.debug("Entered");
844  throw new UnsupportedOperationException("Not supported yet,"
845  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
846  + " class:" + new Throwable().getStackTrace()[0].getClassName()
847  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
848  }
849 
850  @Override
851  public boolean execute(String sql) throws SQLException {
852  HEAVYDBLOGGER.debug("Entered");
853  throw new UnsupportedOperationException("Not supported yet,"
854  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
855  + " class:" + new Throwable().getStackTrace()[0].getClassName()
856  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
857  }
858 
859  @Override
860  public ResultSet getResultSet() throws SQLException {
861  HEAVYDBLOGGER.debug("Entered");
862  return stmt.getResultSet();
863  }
864 
865  @Override
866  public int getUpdateCount() throws SQLException {
867  HEAVYDBLOGGER.debug("Entered");
868  return stmt.getUpdateCount();
869  }
870 
871  @Override
872  public boolean getMoreResults() throws SQLException {
873  HEAVYDBLOGGER.debug("Entered");
874  return stmt.getMoreResults();
875  }
876 
877  @Override
878  public void setFetchDirection(int direction) throws SQLException {
879  HEAVYDBLOGGER.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  HEAVYDBLOGGER.debug("Entered");
889  return ResultSet.FETCH_FORWARD;
890  }
891 
892  @Override
893  public void setFetchSize(int rows) throws SQLException {
894  HEAVYDBLOGGER.debug("Entered");
895  // TODO we need to chnage the model to allow smaller select chunks at the moment
896  // you
897  // get everything
898  }
899 
900  @Override
901  public int getFetchSize() throws SQLException {
902  HEAVYDBLOGGER.debug("Entered");
903  throw new UnsupportedOperationException("Not supported yet,"
904  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
905  + " class:" + new Throwable().getStackTrace()[0].getClassName()
906  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
907  }
908 
909  @Override
910  public int getResultSetConcurrency() throws SQLException {
911  HEAVYDBLOGGER.debug("Entered");
912  throw new UnsupportedOperationException("Not supported yet,"
913  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
914  + " class:" + new Throwable().getStackTrace()[0].getClassName()
915  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
916  }
917 
918  @Override
919  public int getResultSetType() throws SQLException {
920  HEAVYDBLOGGER.debug("Entered");
921  throw new UnsupportedOperationException("Not supported yet,"
922  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
923  + " class:" + new Throwable().getStackTrace()[0].getClassName()
924  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
925  }
926 
927  @Override
928  public void addBatch(String sql) throws SQLException {
929  HEAVYDBLOGGER.debug("Entered");
930  throw new UnsupportedOperationException("Not supported yet,"
931  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
932  + " class:" + new Throwable().getStackTrace()[0].getClassName()
933  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
934  }
935 
936  @Override
937  public void clearBatch() throws SQLException {
938  HEAVYDBLOGGER.debug("Entered");
939  if (rows != null) {
940  rows.clear();
941  }
942  }
943 
944  @Override
945  public int[] executeBatch() throws SQLException {
946  checkClosed();
947  int ret[] = null;
948  if (rows != null) {
949  HEAVYDBLOGGER.debug("executeBatch, rows=" + rows.size());
950  try {
951  // send the batch
952  client.load_table(session, insertTableName, rows, Arrays.asList(listOfFields));
953  } catch (TDBException ex) {
954  throw new SQLException("executeBatch failed: " + ex.getError_msg());
955  } catch (TException ex) {
956  throw new SQLException("executeBatch failed: " + ex.toString());
957  }
958  ret = new int[rows.size()];
959  for (int i = 0; i < rows.size(); i++) {
960  ret[i] = 1;
961  }
962  clearBatch();
963  }
964  return ret;
965  }
966 
967  @Override
968  public Connection getConnection() throws SQLException {
969  HEAVYDBLOGGER.debug("Entered");
970  return stmt.getConnection();
971  }
972 
973  @Override
974  public boolean getMoreResults(int current) throws SQLException {
975  HEAVYDBLOGGER.debug("Entered");
976  throw new UnsupportedOperationException("Not supported yet,"
977  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
978  + " class:" + new Throwable().getStackTrace()[0].getClassName()
979  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
980  }
981 
982  @Override
983  public ResultSet getGeneratedKeys() throws SQLException {
984  HEAVYDBLOGGER.debug("Entered");
985  throw new UnsupportedOperationException("Not supported yet,"
986  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
987  + " class:" + new Throwable().getStackTrace()[0].getClassName()
988  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
989  }
990 
991  @Override
992  public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException {
993  HEAVYDBLOGGER.debug("Entered");
994  throw new UnsupportedOperationException("Not supported yet,"
995  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
996  + " class:" + new Throwable().getStackTrace()[0].getClassName()
997  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
998  }
999 
1000  @Override
1001  public int executeUpdate(String sql, int[] columnIndexes) throws SQLException {
1002  HEAVYDBLOGGER.debug("Entered");
1003  throw new UnsupportedOperationException("Not supported yet,"
1004  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
1005  + " class:" + new Throwable().getStackTrace()[0].getClassName()
1006  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
1007  }
1008 
1009  @Override
1010  public int executeUpdate(String sql, String[] columnNames) throws SQLException {
1011  HEAVYDBLOGGER.debug("Entered");
1012  throw new UnsupportedOperationException("Not supported yet,"
1013  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
1014  + " class:" + new Throwable().getStackTrace()[0].getClassName()
1015  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
1016  }
1017 
1018  @Override
1019  public boolean execute(String sql, int autoGeneratedKeys) throws SQLException {
1020  HEAVYDBLOGGER.debug("Entered");
1021  throw new UnsupportedOperationException("Not supported yet,"
1022  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
1023  + " class:" + new Throwable().getStackTrace()[0].getClassName()
1024  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
1025  }
1026 
1027  @Override
1028  public boolean execute(String sql, int[] columnIndexes) throws SQLException {
1029  HEAVYDBLOGGER.debug("Entered");
1030  throw new UnsupportedOperationException("Not supported yet,"
1031  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
1032  + " class:" + new Throwable().getStackTrace()[0].getClassName()
1033  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
1034  }
1035 
1036  @Override
1037  public boolean execute(String sql, String[] columnNames) throws SQLException {
1038  HEAVYDBLOGGER.debug("Entered");
1039  throw new UnsupportedOperationException("Not supported yet,"
1040  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
1041  + " class:" + new Throwable().getStackTrace()[0].getClassName()
1042  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
1043  }
1044 
1045  @Override
1046  public int getResultSetHoldability() throws SQLException {
1047  HEAVYDBLOGGER.debug("Entered");
1048  throw new UnsupportedOperationException("Not supported yet,"
1049  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
1050  + " class:" + new Throwable().getStackTrace()[0].getClassName()
1051  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
1052  }
1053 
1054  @Override
1055  public boolean isClosed() throws SQLException {
1056  HEAVYDBLOGGER.debug("Entered");
1057  return isClosed;
1058  }
1059 
1060  @Override
1061  public void setPoolable(boolean poolable) throws SQLException {
1062  HEAVYDBLOGGER.debug("Entered");
1063  throw new UnsupportedOperationException("Not supported yet,"
1064  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
1065  + " class:" + new Throwable().getStackTrace()[0].getClassName()
1066  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
1067  }
1068 
1069  @Override
1070  public boolean isPoolable() throws SQLException {
1071  HEAVYDBLOGGER.debug("Entered");
1072  throw new UnsupportedOperationException("Not supported yet,"
1073  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
1074  + " class:" + new Throwable().getStackTrace()[0].getClassName()
1075  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
1076  }
1077 
1078  @Override
1079  public void closeOnCompletion() throws SQLException {
1080  HEAVYDBLOGGER.debug("Entered");
1081  throw new UnsupportedOperationException("Not supported yet,"
1082  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
1083  + " class:" + new Throwable().getStackTrace()[0].getClassName()
1084  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
1085  }
1086 
1087  @Override
1088  public boolean isCloseOnCompletion() throws SQLException {
1089  HEAVYDBLOGGER.debug("Entered");
1090  throw new UnsupportedOperationException("Not supported yet,"
1091  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
1092  + " class:" + new Throwable().getStackTrace()[0].getClassName()
1093  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
1094  }
1095 
1096  @Override
1097  public <T> T unwrap(Class<T> iface) throws SQLException {
1098  HEAVYDBLOGGER.debug("Entered");
1099  throw new UnsupportedOperationException("Not supported yet,"
1100  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
1101  + " class:" + new Throwable().getStackTrace()[0].getClassName()
1102  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
1103  }
1104 
1105  @Override
1106  public boolean isWrapperFor(Class<?> iface) throws SQLException {
1107  HEAVYDBLOGGER.debug("Entered");
1108  throw new UnsupportedOperationException("Not supported yet,"
1109  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
1110  + " class:" + new Throwable().getStackTrace()[0].getClassName()
1111  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
1112  }
1113 
1114  private void checkClosed() throws SQLException {
1115  if (isClosed) {
1116  throw new SQLException("PreparedStatement is closed.");
1117  }
1118  }
1119 }
void setBlob(int parameterIndex, InputStream inputStream, long length)
void setClob(int parameterIndex, Reader reader)
void setRowId(int parameterIndex, RowId x)
void setNCharacterStream(int parameterIndex, Reader value, long length)
void setSQLXML(int parameterIndex, SQLXML xmlObject)
size_t append(FILE *f, const size_t size, const int8_t *buf)
Appends the specified number of bytes to the end of the file f from buf.
Definition: File.cpp:158
void setBoolean(int parameterIndex, boolean x)
void setBinaryStream(int parameterIndex, InputStream x)
void setClob(int parameterIndex, Reader reader, long length)
void setUnicodeStream(int parameterIndex, InputStream x, int length)
void setObject(int parameterIndex, Object x)
void setBytes(int parameterIndex, byte[] x)
void setCharacterStream(int parameterIndex, Reader reader)
void setBinaryStream(int parameterIndex, InputStream x, int length)
void setNClob(int parameterIndex, Reader reader)
boolean execute(String sql, int[] columnIndexes)
int executeUpdate(String sql, int[] columnIndexes)
void setDouble(int parameterIndex, double x)
void setTimestamp(int parameterIndex, Timestamp x, Calendar cal)
void setNClob(int parameterIndex, NClob value)
void setAsciiStream(int parameterIndex, InputStream x, long length)
void setNull(int parameterIndex, int sqlType, String typeName)
void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength)
HeavyAIPreparedStatement(String sql, String session, HeavyAIConnection connection)
void setBinaryStream(int parameterIndex, InputStream x, long length)
void setObject(int parameterIndex, Object x, int targetSqlType)
void setTimestamp(int parameterIndex, Timestamp x)
boolean execute(String sql, String[] columnNames)
int executeUpdate(String sql, int autoGeneratedKeys)
void setAsciiStream(int parameterIndex, InputStream x, int length)
void setNull(int parameterIndex, int sqlType)
void setBlob(int parameterIndex, InputStream inputStream)
void setCharacterStream(int parameterIndex, Reader reader, int length)
void setDate(int parameterIndex, Date x, Calendar cal)
void setString(int parameterIndex, String x)
void setBigDecimal(int parameterIndex, BigDecimal x)
std::string typeName(const T *v)
Definition: toString.h:106
void setShort(int parameterIndex, short x)
void setCharacterStream(int parameterIndex, Reader reader, long length)
void setNString(int parameterIndex, String value)
void setAsciiStream(int parameterIndex, InputStream x)
void setNClob(int parameterIndex, Reader reader, long length)
void setNCharacterStream(int parameterIndex, Reader value)
string name
Definition: setup.in.py:72
void setFloat(int parameterIndex, float x)
boolean execute(String sql, int autoGeneratedKeys)
int executeUpdate(String sql, String[] columnNames)
void setArray(int parameterIndex, Array x)
void setTime(int parameterIndex, Time x, Calendar cal)