16 package ai.heavy.jdbc;
18 import org.apache.thrift.TException;
19 import org.slf4j.Logger;
20 import org.slf4j.LoggerFactory;
22 import java.io.InputStream;
23 import java.io.Reader;
24 import java.math.BigDecimal;
26 import java.sql.Array;
29 import java.sql.Connection;
31 import java.sql.NClob;
32 import java.sql.ParameterMetaData;
33 import java.sql.PreparedStatement;
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;
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;
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;
60 LoggerFactory.getLogger(HeavyAIPreparedStatement.class);
77 private List<TStringRow>
rows = null;
78 private static final Pattern
REGEX_PATTERN = Pattern.compile(
"(?i)\\s+INTO\\s+(\\w+)");
80 "(?i)\\s*insert\\s+into\\s+[\\w:\\.]+\\s*\\(([\\w:\\s:\\,:\\']+)\\)[\\w:\\s]+\\(");
84 Pattern.compile(
"^(?:\\s|--.*?\\R|/\\*[\\S\\s]*?\\*/|\\s*)*\\s*select[\\S\\s]*",
85 Pattern.CASE_INSENSITIVE | Pattern.MULTILINE);
89 HEAVYDBLOGGER.debug(
"Entered");
91 this.client = connection.client;
94 HEAVYDBLOGGER.debug(
"Prepared statement is " +
currentSQL);
104 if (currentSQL.toUpperCase().contains(
"INSERT ")) {
108 currentSQL = currentSQL.replaceAll(
"\"",
" ");
109 HEAVYDBLOGGER.debug(
"Insert Prepared statement is " +
currentSQL);
111 Matcher matcher = REGEX_PATTERN.matcher(
currentSQL);
112 while (matcher.find()) {
114 HEAVYDBLOGGER.debug(
"Table name for insert is '" +
insertTableName +
"'");
124 throw new UnsupportedOperationException(
125 "Incorrect number of replace parameters for prepared statement "
128 StringBuilder modQuery =
new StringBuilder(
currentSQL.length() * 5);
129 for (
int i = 0; i <
repCount; i++) {
132 modQuery.append(
"NULL");
142 qsql = modQuery.toString();
147 qsql = qsql.replace(
" WHERE 1=0",
" LIMIT 1 ");
148 HEAVYDBLOGGER.debug(
"Query is now " + qsql);
154 Matcher matcher = REGEX_IS_SELECT_PATTERN.matcher(
currentSQL);
155 return matcher.matches();
162 HEAVYDBLOGGER.debug(
"executeQuery, sql=" + qsql);
163 return stmt.executeQuery(qsql);
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());
173 HEAVYDBLOGGER.debug(
"Entered");
181 public void setNull(
int parameterIndex,
int sqlType)
throws SQLException {
182 HEAVYDBLOGGER.debug(
"Entered");
188 public void setBoolean(
int parameterIndex,
boolean x)
throws SQLException {
189 HEAVYDBLOGGER.debug(
"Entered");
190 parmRep[parameterIndex - 1] = x ?
"true" :
"false";
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());
206 public void setShort(
int parameterIndex,
short x)
throws SQLException {
207 HEAVYDBLOGGER.debug(
"Entered");
208 parmRep[parameterIndex - 1] = Short.toString(x);
214 public void setInt(
int parameterIndex,
int x)
throws SQLException {
215 HEAVYDBLOGGER.debug(
"Entered");
216 parmRep[parameterIndex - 1] = Integer.toString(x);
222 public void setLong(
int parameterIndex,
long x)
throws SQLException {
223 HEAVYDBLOGGER.debug(
"Entered");
224 parmRep[parameterIndex - 1] = Long.toString(x);
230 public void setFloat(
int parameterIndex,
float x)
throws SQLException {
231 HEAVYDBLOGGER.debug(
"Entered");
232 parmRep[parameterIndex - 1] = Float.toString(x);
238 public void setDouble(
int parameterIndex,
double x)
throws SQLException {
239 HEAVYDBLOGGER.debug(
"Entered");
240 parmRep[parameterIndex - 1] = Double.toString(x);
246 public void setBigDecimal(
int parameterIndex, BigDecimal x)
throws SQLException {
247 HEAVYDBLOGGER.debug(
"Entered");
248 parmRep[parameterIndex - 1] = x.toString();
254 public void setString(
int parameterIndex, String x)
throws SQLException {
255 HEAVYDBLOGGER.debug(
"Entered");
257 x = x.replaceAll(
"'",
"''");
258 parmRep[parameterIndex - 1] = x;
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());
274 public void setDate(
int parameterIndex,
Date x)
throws SQLException {
275 HEAVYDBLOGGER.debug(
"Entered");
276 parmRep[parameterIndex - 1] = x.toString();
283 public void setTime(
int parameterIndex,
Time x)
throws SQLException {
284 HEAVYDBLOGGER.debug(
"Entered");
285 parmRep[parameterIndex - 1] = x.toString();
292 public void setTimestamp(
int parameterIndex, Timestamp x)
throws SQLException {
293 HEAVYDBLOGGER.debug(
"Entered");
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());
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());
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());
333 HEAVYDBLOGGER.debug(
"Entered");
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());
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());
357 public boolean execute() throws SQLException {
358 HEAVYDBLOGGER.debug(
"Entered");
360 return stmt.execute(tQuery);
365 HEAVYDBLOGGER.debug(
"Entered");
370 Matcher matcher = REGEX_LOF_PATTERN.matcher(
currentSQL);
371 if (matcher.find()) {
372 listOfFields = matcher.group(1).trim().split(
"\\s*,+\\s*,*\\s*");
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");
379 List<String> listOfColumns =
new ArrayList<String>();
381 TTableDetails tableDetails =
383 for (TColumnType column : tableDetails.row_desc) {
384 listOfColumns.add(column.col_name.toLowerCase());
386 }
catch (TException ex) {
387 throw new SQLException(ex.toString());
390 if (listOfColumns.indexOf(paramName) == -1) {
391 throw new SQLException(
392 "Column " + paramName.toLowerCase() +
" does not exist");
399 rows =
new ArrayList(5000);
403 TStringRow tsr =
new TStringRow();
406 TStringValue tsv =
new TStringValue();
410 tsv.str_val = this.parmRep[i];
416 HEAVYDBLOGGER.debug(
"addBatch, rows=" + rows.size());
418 throw new UnsupportedOperationException(
"addBatch only supported for insert, line:"
419 +
new Throwable().getStackTrace()[0].getLineNumber());
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());
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());
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());
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());
461 public void setArray(
int parameterIndex, Array x)
throws SQLException {
462 HEAVYDBLOGGER.debug(
"Entered");
463 parmRep[parameterIndex - 1] = x.toString();
470 HEAVYDBLOGGER.debug(
"Entered");
477 PreparedStatement ps = null;
482 for (
int i = 1; i <= this.parmCount; ++i) {
483 ps.setNull(i, Types.NULL);
485 ResultSet rs = ps.executeQuery();
487 return rs.getMetaData();
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());
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());
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());
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());
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());
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());
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());
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());
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());
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());
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());
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());
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());
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());
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());
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());
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());
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());
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());
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());
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());
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());
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());
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());
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());
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());
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());
753 public void close() throws SQLException {
754 HEAVYDBLOGGER.debug(
"close");
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());
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());
783 HEAVYDBLOGGER.debug(
"Entered");
784 return stmt.getMaxRows();
789 HEAVYDBLOGGER.debug(
"Entered");
790 HEAVYDBLOGGER.debug(
"SetMaxRows to " + max);
791 stmt.setMaxRows(max);
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());
805 HEAVYDBLOGGER.debug(
"Entered");
811 HEAVYDBLOGGER.debug(
"Entered");
812 SQLWarning warning =
new SQLWarning(
813 "Query timeouts are not supported. Substituting a value of zero.");
817 rootWarning.setNextWarning(warning);
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());
831 HEAVYDBLOGGER.debug(
"Entered");
837 HEAVYDBLOGGER.debug(
"Entered");
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());
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());
861 HEAVYDBLOGGER.debug(
"Entered");
862 return stmt.getResultSet();
867 HEAVYDBLOGGER.debug(
"Entered");
868 return stmt.getUpdateCount();
873 HEAVYDBLOGGER.debug(
"Entered");
874 return stmt.getMoreResults();
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());
888 HEAVYDBLOGGER.debug(
"Entered");
889 return ResultSet.FETCH_FORWARD;
894 HEAVYDBLOGGER.debug(
"Entered");
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());
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());
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());
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());
938 HEAVYDBLOGGER.debug(
"Entered");
949 HEAVYDBLOGGER.debug(
"executeBatch, rows=" + rows.size());
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());
958 ret =
new int[rows.size()];
959 for (
int i = 0; i < rows.size(); i++) {
969 HEAVYDBLOGGER.debug(
"Entered");
970 return stmt.getConnection();
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());
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());
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());
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());
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());
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());
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());
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());
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());
1056 HEAVYDBLOGGER.debug(
"Entered");
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());
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());
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());
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());
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());
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());
1116 throw new SQLException(
"PreparedStatement is closed.");
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)
void setByte(int parameterIndex, byte x)
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.
boolean execute(String sql)
ResultSet getGeneratedKeys()
void setBoolean(int parameterIndex, boolean x)
void setBinaryStream(int parameterIndex, InputStream x)
void setClob(int parameterIndex, Clob x)
void setClob(int parameterIndex, Reader reader, long length)
void setRef(int parameterIndex, Ref x)
void setUnicodeStream(int parameterIndex, InputStream x, int length)
void setFetchSize(int rows)
void setObject(int parameterIndex, Object x)
void setBlob(int parameterIndex, Blob x)
void setBytes(int parameterIndex, byte[] x)
void addBatch(String sql)
void setCharacterStream(int parameterIndex, Reader reader)
void setLong(int parameterIndex, long x)
void setBinaryStream(int parameterIndex, InputStream x, int length)
boolean getMoreResults(int current)
void setInt(int parameterIndex, int x)
void setDate(int parameterIndex, Date x)
int executeUpdate(String sql)
void setNClob(int parameterIndex, Reader reader)
void setURL(int parameterIndex, URL x)
boolean execute(String sql, int[] columnIndexes)
int executeUpdate(String sql, int[] columnIndexes)
void setMaxFieldSize(int max)
ResultSetMetaData getMetaData()
void setDouble(int parameterIndex, double x)
void setTimestamp(int parameterIndex, Timestamp x, Calendar cal)
void setNClob(int parameterIndex, NClob value)
int getResultSetConcurrency()
static final Pattern REGEX_LOF_PATTERN
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)
boolean isWrapperFor(Class<?> iface)
HeavyAIPreparedStatement(String sql, String session, HeavyAIConnection connection)
void setTime(int parameterIndex, Time x)
void setBinaryStream(int parameterIndex, InputStream x, long length)
void setObject(int parameterIndex, Object x, int targetSqlType)
void setTimestamp(int parameterIndex, Timestamp x)
Connection getConnection()
boolean execute(String sql, String[] columnNames)
static final Pattern REGEX_IS_SELECT_PATTERN
void setCursorName(String name)
int executeUpdate(String sql, int autoGeneratedKeys)
void setAsciiStream(int parameterIndex, InputStream x, int length)
void setNull(int parameterIndex, int sqlType)
void setFetchDirection(int direction)
void setPoolable(boolean poolable)
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)
static final Logger HEAVYDBLOGGER
void setShort(int parameterIndex, short x)
void setCharacterStream(int parameterIndex, Reader reader, long length)
void setNString(int parameterIndex, String value)
int getResultSetHoldability()
void setAsciiStream(int parameterIndex, InputStream x)
ResultSet executeQuery(String sql)
void setNClob(int parameterIndex, Reader reader, long length)
boolean isCloseOnCompletion()
void setNCharacterStream(int parameterIndex, Reader value)
ParameterMetaData getParameterMetaData()
static final Pattern REGEX_PATTERN
void setEscapeProcessing(boolean enable)
void setQueryTimeout(int seconds)
void setFloat(int parameterIndex, float x)
boolean execute(String sql, int autoGeneratedKeys)
int executeUpdate(String sql, String[] columnNames)
public< T > T unwrap(Class< T > iface)
void setArray(int parameterIndex, Array x)
void setTime(int parameterIndex, Time x, Calendar cal)