2 * Copyright (c) 2014, 2015 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.controller.md.sal.dom.xsql.jdbc;
11 import java.io.InputStream;
12 import java.io.Reader;
13 import java.io.Serializable;
14 import java.lang.reflect.Method;
15 import java.math.BigDecimal;
17 import java.sql.Array;
21 import java.sql.NClob;
23 import java.sql.ResultSet;
24 import java.sql.ResultSetMetaData;
25 import java.sql.RowId;
26 import java.sql.SQLException;
27 import java.sql.SQLWarning;
28 import java.sql.SQLXML;
29 import java.sql.Statement;
31 import java.sql.Timestamp;
32 import java.util.ArrayList;
33 import java.util.Calendar;
34 import java.util.Collection;
35 import java.util.HashMap;
36 import java.util.HashSet;
37 import java.util.LinkedList;
38 import java.util.List;
41 import java.util.concurrent.ConcurrentHashMap;
43 import org.opendaylight.controller.md.sal.dom.xsql.XSQLAdapter;
44 import org.opendaylight.controller.md.sal.dom.xsql.XSQLBluePrint;
45 import org.opendaylight.controller.md.sal.dom.xsql.XSQLBluePrintNode;
46 import org.opendaylight.controller.md.sal.dom.xsql.XSQLColumn;
47 import org.opendaylight.controller.md.sal.dom.xsql.XSQLCriteria;
48 import org.opendaylight.controller.md.sal.dom.xsql.XSQLODLUtils;
49 import org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode;
52 * @author Sharon Aicler(saichler@gmail.com)
55 * To be removed in Nitrogen
58 public class JDBCResultSet implements Serializable, ResultSet, ResultSetMetaData {
59 private static final long serialVersionUID = -7450200738431047057L;
60 private static final ClassLoader CLASS_LOADER = JDBCResultSet.class.getClassLoader();
61 private static final Class<?>[] PROXY_INTERFACES = new Class[] { ResultSet.class };
62 private static int nextID = 0;
64 private String sql = null;
65 private List<XSQLBluePrintNode> tablesInQuery = new ArrayList<>();
66 private Map<String, XSQLBluePrintNode> tablesInQueryMap = new ConcurrentHashMap<>();
67 private List<XSQLColumn> fieldsInQuery = new ArrayList<>();
68 private transient LinkedList<Map<String, Object>> records = new LinkedList<>();
69 private transient Map<String, Object> currentRecord = null;
70 private boolean finished = false;
72 public int numberOfTasks = 0;
73 private Map<String, Map<XSQLColumn, List<XSQLCriteria>>> criteria = new ConcurrentHashMap<>();
74 private Exception err = null;
75 private List<Record> EMPTY_RESULT = new LinkedList<>();
76 private transient Map<String, JDBCResultSet> subQueries = new HashMap<>();
78 public ResultSet getProxy() {
80 //return (ResultSet) Proxy.newProxyInstance(CLASS_LOADER, PROXY_INTERFACES, new JDBCProxy(this));
83 public void setSQL(String _sql) {
87 public JDBCResultSet addSubQuery(String _sql, String logicalName) {
88 if (subQueries == null) {
89 subQueries = new HashMap<>();
91 JDBCResultSet rs = new JDBCResultSet(_sql);
92 this.subQueries.put(logicalName, rs);
96 public Map<String, JDBCResultSet> getSubQueries() {
97 if (this.subQueries == null) {
98 this.subQueries = new HashMap<>();
100 return this.subQueries;
103 public JDBCResultSet(String _sql) {
104 synchronized (JDBCResultSet.class) {
111 public String getSQL() {
115 public void setError(Exception _err) {
119 public Exception getError() {
123 public void updateData(JDBCResultSet rs) {
124 synchronized (this) {
125 this.tablesInQuery = rs.tablesInQuery;
126 this.tablesInQueryMap = rs.tablesInQueryMap;
127 this.fieldsInQuery = rs.fieldsInQuery;
132 public int isObjectFitCriteria(Map<String, Object> objValues,
134 Map<XSQLColumn, List<XSQLCriteria>> tblCriteria = criteria
136 if (tblCriteria == null) {
139 for (Map.Entry<XSQLColumn, List<XSQLCriteria>> cc : tblCriteria
141 for (XSQLCriteria c : cc.getValue()) {
142 Object value = objValues.get(cc.getKey().toString());
143 int result = c.checkValue(value);
152 public int isObjectFitCriteria(Object element, Class<?> cls) {
153 Map<XSQLColumn, List<XSQLCriteria>> tblCriteria = criteria.get(cls
155 if (tblCriteria == null) {
158 for (Map.Entry<XSQLColumn, List<XSQLCriteria>> cc : tblCriteria
160 for (XSQLCriteria c : cc.getValue()) {
161 int result = c.isObjectFitCriteria(element, cc.getKey()
171 public Map<String, Map<XSQLColumn, List<XSQLCriteria>>> getCriteria() {
172 return this.criteria;
179 public List<XSQLBluePrintNode> getTables() {
180 return tablesInQuery;
183 public void addTableToQuery(XSQLBluePrintNode node) {
184 if (this.tablesInQueryMap.containsKey(node.getBluePrintNodeName())) {
187 this.tablesInQuery.add(node);
188 this.tablesInQueryMap.put(node.getBluePrintNodeName(), node);
191 public List<XSQLColumn> getFields() {
192 return this.fieldsInQuery;
195 public XSQLBluePrintNode getMainTable() {
196 if (tablesInQuery.size() == 1) {
197 return tablesInQuery.get(0);
199 XSQLBluePrintNode result = null;
200 for (XSQLBluePrintNode node : tablesInQuery) {
201 if (result == null) {
203 } else if (result.getLevel() < node.getLevel()) {
210 public boolean isFinished() {
214 public void setFinished(boolean b) {
219 return this.records.size();
222 public void addRecord(Map<String, Object> r) {
223 synchronized (this) {
224 if (records == null) {
225 records = new LinkedList<>();
232 public void addRecord(ArrayList<?> hierarchy) {
233 Map<String, Object> rec = new HashMap<>();
234 for (int i = hierarchy.size() - 1; i >= 0; i--) {
235 Object element = hierarchy.get(i);
236 for (XSQLColumn c : fieldsInQuery) {
237 if (c.getTableName().equals(element.getClass().getSimpleName())) {
239 Method m = element.getClass().getMethod(c.getName(),
241 Object value = m.invoke(element, null);
242 rec.put(c.getName(), value);
243 } catch (Exception err) {
244 err.printStackTrace();
249 this.records.add(rec);
252 public boolean next() {
253 this.currentRecord = null;
254 if (records == null) {
255 records = new LinkedList<>();
257 while (!finished || records.size() > 0) {
258 synchronized (this) {
259 if (records.size() == 0) {
262 } catch (Exception err) {
264 if (records.size() > 0) {
266 currentRecord = records.removeFirst();
274 currentRecord = records.removeFirst();
285 public Map<String, Object> getCurrent() {
286 return this.currentRecord;
289 private void createRecord(Object data, XSQLBluePrintNode node) {
290 Map<String, Object> rec = new HashMap<>();
291 for (XSQLColumn c : this.fieldsInQuery) {
292 if (c.getTableName().equals(node.getBluePrintNodeName())) {
294 Method m = node.getInterface().getMethod(c.getName(), null);
295 Object value = m.invoke(data, null);
297 rec.put(c.getName(), value);
299 rec.put(c.getName(), "");
301 } catch (Exception err) {
302 err.printStackTrace();
309 public static class Record {
310 // The map container the Attribute 2 the attribute value
311 public Map<String, Object> data = new HashMap<>();
312 // The Element Object (Possibly some kind of NormalizedNode
313 public Object element = null;
314 // Does this record fit the criteria
315 // In case of a list property, we first collect the list and only then
317 // we decide which list item should be included or not.
318 public boolean fitCriteria = true;
320 public Map<String, Object> getRecord() {
325 public static class RecordsContainer {
326 public List<Record> records = new LinkedList<>();
327 public List<Record> fitRecords = new LinkedList<>();
328 public Object currentObject = null;
331 private void collectColumnValues(RecordsContainer rContainer,
332 XSQLBluePrintNode bpn) {
333 Collection<?> subChildren = XSQLODLUtils
334 .getChildrenCollection(rContainer.currentObject);
335 Record r = new Record();
336 r.element = rContainer.currentObject;
337 for (Object stc : subChildren) {
338 if (stc.getClass().getName()
339 .endsWith("ImmutableUnkeyedListEntryNode")) {
340 r.fitCriteria = false;
341 rContainer.currentObject = stc;
342 collectColumnValues(rContainer, bpn);
343 } else if (stc.getClass().getName()
344 .endsWith("ImmutableAugmentationNode")) {
345 Map<?, ?> values = XSQLODLUtils.getChildren(stc);
346 for (Object key : values.keySet()) {
347 Object val = values.get(key);
348 if (val.getClass().getName().endsWith("ImmutableLeafNode")) {
349 Object value = XSQLODLUtils.getValue(val);
350 String k = XSQLODLUtils.getNodeName(val);
352 r.data.put(bpn.getBluePrintNodeName() + "." + k,
357 } else if (stc.getClass().getName().endsWith("ImmutableLeafNode")) {
358 String k = XSQLODLUtils.getNodeName(stc);
359 Object value = XSQLODLUtils.getValue(stc);
361 r.data.put(bpn.getBluePrintNodeName() + "." + k,
367 rContainer.records.add(r);
371 private void addToData(Record rec, XSQLBluePrintNode bpn,XSQLBluePrint bluePrint, Map<String, Object> fullRecord) {
372 XSQLBluePrintNode eNodes[] = bluePrint
373 .getBluePrintNodeByODLTableName(XSQLODLUtils
374 .getNodeIdentiofier(rec.element));
376 for (XSQLColumn c : fieldsInQuery) {
377 for (XSQLBluePrintNode eNode : eNodes) {
378 if (((XSQLBluePrintNode) c.getBluePrintNode())
379 .getBluePrintNodeName().equals(
380 eNode.getBluePrintNodeName())) {
381 // Object value = Criteria.getValue(rec.element,
383 String columnName = c.toString();
384 Object value = fullRecord.get(columnName);
387 Object rsValue = c.getResultSetValue(value);
388 c.setCharWidth(rsValue.toString().length());
389 rec.data.put(columnName, rsValue);
390 } catch (Exception err) {
399 private boolean beenHere(Set<String> beenHereElement, Object element) {
400 if (beenHereElement == null) {
401 beenHereElement = new HashSet<>();
404 String elementKey = null;
407 elementKey = element.toString();
408 } catch (Exception err) {
409 elementKey = "Unknown";
412 if (beenHereElement.contains(elementKey)) {
416 beenHereElement.add(elementKey);
420 public List<Object> getChildren(Object node, String tableName,
421 XSQLBluePrint bluePrint) {
423 List<Object> children = XSQLODLUtils.getMChildren(node);
424 List<Object> result = new LinkedList<>();
426 for (Object child : children) {
428 String odlNodeName = XSQLODLUtils.getNodeIdentiofier(child);
429 if (odlNodeName == null) {
430 if (child instanceof DataContainerNode) {
431 List<Object> augChidlren = getChildren(child, tableName,
433 result.addAll(augChidlren);
438 XSQLBluePrintNode eNodes[] = bluePrint
439 .getBluePrintNodeByODLTableName(odlNodeName);
440 if (eNodes == null) {
444 boolean match = false;
445 for (XSQLBluePrintNode enode : eNodes) {
446 if (tableName.startsWith(enode.toString())) {
456 if (child.getClass().getName().endsWith("ImmutableUnkeyedListNode")) {
458 } else if (child.getClass().getName()
459 .endsWith("ImmutableContainerNode")) {
461 } else if (child.getClass().getName()
462 .endsWith("ImmutableAugmentationNode")) {
463 List<Object> _children = XSQLODLUtils.getMChildren(child);
464 for (Object c : _children) {
465 if (c.getClass().getName()
466 .endsWith("ImmutableContainerNode")) {
470 } else if (child.getClass().getName().endsWith("ImmutableMapNode")) {
471 result.addAll(XSQLODLUtils.getMChildren(child));
473 XSQLAdapter.log("Missed Node Data OF Type="
474 + child.getClass().getName());
480 public List<Record> addRecords(Object element, XSQLBluePrintNode node,
481 boolean root, String tableName, XSQLBluePrint bluePrint) {
482 List<Record> result = new LinkedList<>();
483 String nodeID = XSQLODLUtils.getNodeIdentiofier(element);
484 if (node.getODLTableName().equals(nodeID)) {
485 XSQLBluePrintNode bluePrintNode = bluePrint
486 .getBluePrintNodeByODLTableName(nodeID)[0];
487 RecordsContainer rContainer = new RecordsContainer();
488 rContainer.currentObject = element;
489 XSQLBluePrintNode bpn = this.tablesInQueryMap.get(bluePrintNode
490 .getBluePrintNodeName());
491 if (this.criteria.containsKey(bluePrintNode.getBluePrintNodeName())
493 collectColumnValues(rContainer, bpn);
494 for (Record r : rContainer.records) {
495 if (!(isObjectFitCriteria(r.data,
496 bpn.getBluePrintNodeName()) == 1)) {
497 r.fitCriteria = false;
500 Record rec = new Record();
501 rec.element = r.element;
502 addToData(rec, bpn, bluePrint, r.data);
503 rContainer.fitRecords.add(rec);
506 if (rContainer.fitRecords.isEmpty())
509 if (rContainer.records.isEmpty()) {
510 Record rec = new Record();
511 rec.element = rContainer.currentObject;
518 for (Record rec : rContainer.fitRecords) {
529 XSQLBluePrintNode parent = node.getParent();
530 List<Record> subRecords = addRecords(element, parent, false, tableName,
532 for (Record subRec : subRecords) {
533 List<Object> subO = getChildren(subRec.element, tableName,
536 for (Object subData : subO) {
537 RecordsContainer rContainer = new RecordsContainer();
538 rContainer.currentObject = subData;
540 String recID = XSQLODLUtils
541 .getNodeIdentiofier(rContainer.currentObject);
542 XSQLBluePrintNode eNodes[] = bluePrint
543 .getBluePrintNodeByODLTableName(recID);
544 XSQLBluePrintNode bpn = null;
545 for (XSQLBluePrintNode eNode : eNodes) {
546 bpn = this.tablesInQueryMap.get(eNode
547 .getBluePrintNodeName());
553 collectColumnValues(rContainer, bpn);
554 for (Record r : rContainer.records) {
555 if ((isObjectFitCriteria(r.data,
556 bpn.getBluePrintNodeName()) == 1)) {
557 Record rec = new Record();
558 rec.data.putAll(subRec.data);
559 rec.element = r.element;
560 addToData(rec, bpn, bluePrint, r.data);
562 r.fitCriteria = false;
566 if (rContainer.records.isEmpty()) {
567 Record rec = new Record();
568 rec.data.putAll(subRec.data);
569 rec.element = rContainer.currentObject;
571 if (!rec.data.isEmpty()) {
578 for (Record r : rContainer.records) {
579 r.data.putAll(subRec.data);
582 if (!r.data.isEmpty()) {
598 public boolean isWrapperFor(Class<?> iface) throws SQLException {
599 // TODO Auto-generated method stub
604 public <T> T unwrap(Class<T> iface) throws SQLException {
605 // TODO Auto-generated method stub
610 public boolean absolute(int row) throws SQLException {
611 // TODO Auto-generated method stub
616 public void afterLast() throws SQLException {
617 // TODO Auto-generated method stub
622 public void beforeFirst() throws SQLException {
623 // TODO Auto-generated method stub
628 public void cancelRowUpdates() throws SQLException {
629 // TODO Auto-generated method stub
634 public void clearWarnings() throws SQLException {
635 // TODO Auto-generated method stub
640 public void close() throws SQLException {
641 // TODO Auto-generated method stub
646 public void deleteRow() throws SQLException {
647 // TODO Auto-generated method stub
652 public int findColumn(String columnLabel) throws SQLException {
653 // TODO Auto-generated method stub
658 public boolean first() throws SQLException {
659 // TODO Auto-generated method stub
664 public Array getArray(int columnIndex) throws SQLException {
665 // TODO Auto-generated method stub
670 public Array getArray(String columnLabel) throws SQLException {
671 // TODO Auto-generated method stub
676 public InputStream getAsciiStream(int columnIndex) throws SQLException {
677 // TODO Auto-generated method stub
682 public InputStream getAsciiStream(String columnLabel) throws SQLException {
683 // TODO Auto-generated method stub
688 public BigDecimal getBigDecimal(int columnIndex, int scale)
689 throws SQLException {
690 // TODO Auto-generated method stub
695 public BigDecimal getBigDecimal(int columnIndex) throws SQLException {
696 // TODO Auto-generated method stub
701 public BigDecimal getBigDecimal(String columnLabel, int scale)
702 throws SQLException {
703 // TODO Auto-generated method stub
708 public BigDecimal getBigDecimal(String columnLabel) throws SQLException {
709 // TODO Auto-generated method stub
714 public InputStream getBinaryStream(int columnIndex) throws SQLException {
715 // TODO Auto-generated method stub
720 public InputStream getBinaryStream(String columnLabel) throws SQLException {
721 // TODO Auto-generated method stub
726 public Blob getBlob(int columnIndex) throws SQLException {
727 // TODO Auto-generated method stub
732 public Blob getBlob(String columnLabel) throws SQLException {
733 // TODO Auto-generated method stub
738 public boolean getBoolean(int columnIndex) throws SQLException {
739 // TODO Auto-generated method stub
744 public boolean getBoolean(String columnLabel) throws SQLException {
745 // TODO Auto-generated method stub
750 public byte getByte(int columnIndex) throws SQLException {
751 // TODO Auto-generated method stub
756 public byte getByte(String columnLabel) throws SQLException {
757 // TODO Auto-generated method stub
762 public byte[] getBytes(int columnIndex) throws SQLException {
763 // TODO Auto-generated method stub
768 public byte[] getBytes(String columnLabel) throws SQLException {
769 // TODO Auto-generated method stub
774 public Reader getCharacterStream(int columnIndex) throws SQLException {
775 // TODO Auto-generated method stub
780 public Reader getCharacterStream(String columnLabel) throws SQLException {
781 // TODO Auto-generated method stub
786 public Clob getClob(int columnIndex) throws SQLException {
787 // TODO Auto-generated method stub
792 public Clob getClob(String columnLabel) throws SQLException {
793 // TODO Auto-generated method stub
798 public int getConcurrency() throws SQLException {
799 // TODO Auto-generated method stub
804 public String getCursorName() throws SQLException {
805 // TODO Auto-generated method stub
810 public Date getDate(int columnIndex, Calendar cal) throws SQLException {
811 // TODO Auto-generated method stub
816 public Date getDate(int columnIndex) throws SQLException {
817 // TODO Auto-generated method stub
822 public Date getDate(String columnLabel, Calendar cal) throws SQLException {
823 // TODO Auto-generated method stub
828 public Date getDate(String columnLabel) throws SQLException {
829 // TODO Auto-generated method stub
834 public double getDouble(int columnIndex) throws SQLException {
835 // TODO Auto-generated method stub
840 public double getDouble(String columnLabel) throws SQLException {
841 // TODO Auto-generated method stub
846 public int getFetchDirection() throws SQLException {
847 // TODO Auto-generated method stub
852 public int getFetchSize() throws SQLException {
853 // TODO Auto-generated method stub
858 public float getFloat(int columnIndex) throws SQLException {
859 // TODO Auto-generated method stub
864 public float getFloat(String columnLabel) throws SQLException {
865 // TODO Auto-generated method stub
870 public int getHoldability() throws SQLException {
871 // TODO Auto-generated method stub
876 public int getInt(int columnIndex) throws SQLException {
877 // TODO Auto-generated method stub
882 public int getInt(String columnLabel) throws SQLException {
883 // TODO Auto-generated method stub
888 public long getLong(int columnIndex) throws SQLException {
889 // TODO Auto-generated method stub
894 public long getLong(String columnLabel) throws SQLException {
895 // TODO Auto-generated method stub
900 public ResultSetMetaData getMetaData() throws SQLException {
905 public Reader getNCharacterStream(int columnIndex) throws SQLException {
906 // TODO Auto-generated method stub
911 public Reader getNCharacterStream(String columnLabel) throws SQLException {
912 // TODO Auto-generated method stub
917 public NClob getNClob(int columnIndex) throws SQLException {
918 // TODO Auto-generated method stub
923 public NClob getNClob(String columnLabel) throws SQLException {
924 // TODO Auto-generated method stub
929 public String getNString(int columnIndex) throws SQLException {
930 // TODO Auto-generated method stub
935 public String getNString(String columnLabel) throws SQLException {
936 // TODO Auto-generated method stub
941 public Object getObject(int columnIndex, Map<String, Class<?>> map)
942 throws SQLException {
943 return getObject(columnIndex);
947 public Object getObject(int columnIndex) throws SQLException {
948 return currentRecord.get(this.fieldsInQuery.get(columnIndex - 1)
953 public Object getObject(String columnLabel, Map<String, Class<?>> map)
954 throws SQLException {
955 return getObject(columnLabel);
959 public Object getObject(String columnLabel) throws SQLException {
960 return currentRecord.get(columnLabel);
964 public Ref getRef(int columnIndex) throws SQLException {
965 // TODO Auto-generated method stub
970 public Ref getRef(String columnLabel) throws SQLException {
971 // TODO Auto-generated method stub
976 public int getRow() throws SQLException {
977 // TODO Auto-generated method stub
982 public RowId getRowId(int columnIndex) throws SQLException {
983 // TODO Auto-generated method stub
988 public RowId getRowId(String columnLabel) throws SQLException {
989 // TODO Auto-generated method stub
994 public SQLXML getSQLXML(int columnIndex) throws SQLException {
995 // TODO Auto-generated method stub
1000 public SQLXML getSQLXML(String columnLabel) throws SQLException {
1001 // TODO Auto-generated method stub
1006 public short getShort(int columnIndex) throws SQLException {
1007 // TODO Auto-generated method stub
1012 public short getShort(String columnLabel) throws SQLException {
1013 // TODO Auto-generated method stub
1018 public Statement getStatement() throws SQLException {
1019 // TODO Auto-generated method stub
1024 public String getString(int columnIndex) throws SQLException {
1029 public String getString(String columnLabel) throws SQLException {
1034 public Time getTime(int columnIndex, Calendar cal) throws SQLException {
1035 // TODO Auto-generated method stub
1040 public Time getTime(int columnIndex) throws SQLException {
1041 // TODO Auto-generated method stub
1046 public Time getTime(String columnLabel, Calendar cal) throws SQLException {
1047 // TODO Auto-generated method stub
1052 public Time getTime(String columnLabel) throws SQLException {
1053 // TODO Auto-generated method stub
1058 public Timestamp getTimestamp(int columnIndex, Calendar cal)
1059 throws SQLException {
1060 // TODO Auto-generated method stub
1065 public Timestamp getTimestamp(int columnIndex) throws SQLException {
1066 // TODO Auto-generated method stub
1071 public Timestamp getTimestamp(String columnLabel, Calendar cal)
1072 throws SQLException {
1073 // TODO Auto-generated method stub
1078 public Timestamp getTimestamp(String columnLabel) throws SQLException {
1079 // TODO Auto-generated method stub
1084 public int getType() throws SQLException {
1085 return ResultSet.TYPE_FORWARD_ONLY;
1089 public URL getURL(int columnIndex) throws SQLException {
1090 // TODO Auto-generated method stub
1095 public URL getURL(String columnLabel) throws SQLException {
1096 // TODO Auto-generated method stub
1101 public InputStream getUnicodeStream(int columnIndex) throws SQLException {
1102 // TODO Auto-generated method stub
1107 public InputStream getUnicodeStream(String columnLabel) throws SQLException {
1108 // TODO Auto-generated method stub
1113 public SQLWarning getWarnings() throws SQLException {
1114 // TODO Auto-generated method stub
1119 public void insertRow() throws SQLException {
1120 // TODO Auto-generated method stub
1125 public boolean isAfterLast() throws SQLException {
1126 // TODO Auto-generated method stub
1131 public boolean isBeforeFirst() throws SQLException {
1132 // TODO Auto-generated method stub
1137 public boolean isClosed() throws SQLException {
1138 // TODO Auto-generated method stub
1143 public boolean isFirst() throws SQLException {
1144 // TODO Auto-generated method stub
1149 public boolean isLast() throws SQLException {
1150 // TODO Auto-generated method stub
1155 public boolean last() throws SQLException {
1156 // TODO Auto-generated method stub
1161 public void moveToCurrentRow() throws SQLException {
1162 // TODO Auto-generated method stub
1167 public void moveToInsertRow() throws SQLException {
1168 // TODO Auto-generated method stub
1173 public boolean previous() throws SQLException {
1174 // TODO Auto-generated method stub
1179 public void refreshRow() throws SQLException {
1180 // TODO Auto-generated method stub
1185 public boolean relative(int rows) throws SQLException {
1186 // TODO Auto-generated method stub
1191 public boolean rowDeleted() throws SQLException {
1192 // TODO Auto-generated method stub
1197 public boolean rowInserted() throws SQLException {
1198 // TODO Auto-generated method stub
1203 public boolean rowUpdated() throws SQLException {
1204 // TODO Auto-generated method stub
1209 public void setFetchDirection(int direction) throws SQLException {
1210 // TODO Auto-generated method stub
1215 public void setFetchSize(int rows) throws SQLException {
1216 // TODO Auto-generated method stub
1221 public void updateArray(int columnIndex, Array x) throws SQLException {
1222 // TODO Auto-generated method stub
1227 public void updateArray(String columnLabel, Array x) throws SQLException {
1228 // TODO Auto-generated method stub
1233 public void updateAsciiStream(int columnIndex, InputStream x, int length)
1234 throws SQLException {
1235 // TODO Auto-generated method stub
1240 public void updateAsciiStream(int columnIndex, InputStream x, long length)
1241 throws SQLException {
1242 // TODO Auto-generated method stub
1247 public void updateAsciiStream(int columnIndex, InputStream x)
1248 throws SQLException {
1249 // TODO Auto-generated method stub
1254 public void updateAsciiStream(String columnLabel, InputStream x, int length)
1255 throws SQLException {
1256 // TODO Auto-generated method stub
1261 public void updateAsciiStream(String columnLabel, InputStream x, long length)
1262 throws SQLException {
1263 // TODO Auto-generated method stub
1268 public void updateAsciiStream(String columnLabel, InputStream x)
1269 throws SQLException {
1270 // TODO Auto-generated method stub
1275 public void updateBigDecimal(int columnIndex, BigDecimal x)
1276 throws SQLException {
1277 // TODO Auto-generated method stub
1282 public void updateBigDecimal(String columnLabel, BigDecimal x)
1283 throws SQLException {
1284 // TODO Auto-generated method stub
1289 public void updateBinaryStream(int columnIndex, InputStream x, int length)
1290 throws SQLException {
1291 // TODO Auto-generated method stub
1296 public void updateBinaryStream(int columnIndex, InputStream x, long length)
1297 throws SQLException {
1298 // TODO Auto-generated method stub
1303 public void updateBinaryStream(int columnIndex, InputStream x)
1304 throws SQLException {
1305 // TODO Auto-generated method stub
1310 public void updateBinaryStream(String columnLabel, InputStream x, int length)
1311 throws SQLException {
1312 // TODO Auto-generated method stub
1317 public void updateBinaryStream(String columnLabel, InputStream x,
1318 long length) throws SQLException {
1319 // TODO Auto-generated method stub
1324 public void updateBinaryStream(String columnLabel, InputStream x)
1325 throws SQLException {
1326 // TODO Auto-generated method stub
1331 public void updateBlob(int columnIndex, Blob x) throws SQLException {
1332 // TODO Auto-generated method stub
1337 public void updateBlob(int columnIndex, InputStream inputStream, long length)
1338 throws SQLException {
1339 // TODO Auto-generated method stub
1344 public void updateBlob(int columnIndex, InputStream inputStream)
1345 throws SQLException {
1346 // TODO Auto-generated method stub
1351 public void updateBlob(String columnLabel, Blob x) throws SQLException {
1352 // TODO Auto-generated method stub
1357 public void updateBlob(String columnLabel, InputStream inputStream,
1358 long length) throws SQLException {
1359 // TODO Auto-generated method stub
1364 public void updateBlob(String columnLabel, InputStream inputStream)
1365 throws SQLException {
1366 // TODO Auto-generated method stub
1371 public void updateBoolean(int columnIndex, boolean x) throws SQLException {
1372 // TODO Auto-generated method stub
1377 public void updateBoolean(String columnLabel, boolean x)
1378 throws SQLException {
1379 // TODO Auto-generated method stub
1384 public void updateByte(int columnIndex, byte x) throws SQLException {
1385 // TODO Auto-generated method stub
1390 public void updateByte(String columnLabel, byte x) throws SQLException {
1391 // TODO Auto-generated method stub
1396 public void updateBytes(int columnIndex, byte[] x) throws SQLException {
1397 // TODO Auto-generated method stub
1402 public void updateBytes(String columnLabel, byte[] x) throws SQLException {
1403 // TODO Auto-generated method stub
1408 public void updateCharacterStream(int columnIndex, Reader x, int length)
1409 throws SQLException {
1410 // TODO Auto-generated method stub
1415 public void updateCharacterStream(int columnIndex, Reader x, long length)
1416 throws SQLException {
1417 // TODO Auto-generated method stub
1422 public void updateCharacterStream(int columnIndex, Reader x)
1423 throws SQLException {
1424 // TODO Auto-generated method stub
1429 public void updateCharacterStream(String columnLabel, Reader reader,
1430 int length) throws SQLException {
1431 // TODO Auto-generated method stub
1436 public void updateCharacterStream(String columnLabel, Reader reader,
1437 long length) throws SQLException {
1438 // TODO Auto-generated method stub
1443 public void updateCharacterStream(String columnLabel, Reader reader)
1444 throws SQLException {
1445 // TODO Auto-generated method stub
1450 public void updateClob(int columnIndex, Clob x) throws SQLException {
1451 // TODO Auto-generated method stub
1456 public void updateClob(int columnIndex, Reader reader, long length)
1457 throws SQLException {
1458 // TODO Auto-generated method stub
1463 public void updateClob(int columnIndex, Reader reader) throws SQLException {
1464 // TODO Auto-generated method stub
1469 public void updateClob(String columnLabel, Clob x) throws SQLException {
1470 // TODO Auto-generated method stub
1475 public void updateClob(String columnLabel, Reader reader, long length)
1476 throws SQLException {
1477 // TODO Auto-generated method stub
1482 public void updateClob(String columnLabel, Reader reader)
1483 throws SQLException {
1484 // TODO Auto-generated method stub
1489 public void updateDate(int columnIndex, Date x) throws SQLException {
1490 // TODO Auto-generated method stub
1495 public void updateDate(String columnLabel, Date x) throws SQLException {
1496 // TODO Auto-generated method stub
1501 public void updateDouble(int columnIndex, double x) throws SQLException {
1502 // TODO Auto-generated method stub
1507 public void updateDouble(String columnLabel, double x) throws SQLException {
1508 // TODO Auto-generated method stub
1513 public void updateFloat(int columnIndex, float x) throws SQLException {
1514 // TODO Auto-generated method stub
1519 public void updateFloat(String columnLabel, float x) throws SQLException {
1520 // TODO Auto-generated method stub
1525 public void updateInt(int columnIndex, int x) throws SQLException {
1526 // TODO Auto-generated method stub
1531 public void updateInt(String columnLabel, int x) throws SQLException {
1532 // TODO Auto-generated method stub
1537 public void updateLong(int columnIndex, long x) throws SQLException {
1538 // TODO Auto-generated method stub
1543 public void updateLong(String columnLabel, long x) throws SQLException {
1544 // TODO Auto-generated method stub
1549 public void updateNCharacterStream(int columnIndex, Reader x, long length)
1550 throws SQLException {
1551 // TODO Auto-generated method stub
1556 public void updateNCharacterStream(int columnIndex, Reader x)
1557 throws SQLException {
1558 // TODO Auto-generated method stub
1563 public void updateNCharacterStream(String columnLabel, Reader reader,
1564 long length) throws SQLException {
1565 // TODO Auto-generated method stub
1570 public void updateNCharacterStream(String columnLabel, Reader reader)
1571 throws SQLException {
1572 // TODO Auto-generated method stub
1577 public void updateNClob(int columnIndex, NClob nClob) throws SQLException {
1578 // TODO Auto-generated method stub
1583 public void updateNClob(int columnIndex, Reader reader, long length)
1584 throws SQLException {
1585 // TODO Auto-generated method stub
1590 public void updateNClob(int columnIndex, Reader reader) throws SQLException {
1591 // TODO Auto-generated method stub
1596 public void updateNClob(String columnLabel, NClob nClob)
1597 throws SQLException {
1598 // TODO Auto-generated method stub
1603 public void updateNClob(String columnLabel, Reader reader, long length)
1604 throws SQLException {
1605 // TODO Auto-generated method stub
1610 public void updateNClob(String columnLabel, Reader reader)
1611 throws SQLException {
1612 // TODO Auto-generated method stub
1617 public void updateNString(int columnIndex, String nString)
1618 throws SQLException {
1619 // TODO Auto-generated method stub
1624 public void updateNString(String columnLabel, String nString)
1625 throws SQLException {
1626 // TODO Auto-generated method stub
1631 public void updateNull(int columnIndex) throws SQLException {
1632 // TODO Auto-generated method stub
1637 public void updateNull(String columnLabel) throws SQLException {
1638 // TODO Auto-generated method stub
1643 public void updateObject(int columnIndex, Object x, int scaleOrLength)
1644 throws SQLException {
1645 // TODO Auto-generated method stub
1650 public void updateObject(int columnIndex, Object x) throws SQLException {
1651 // TODO Auto-generated method stub
1656 public void updateObject(String columnLabel, Object x, int scaleOrLength)
1657 throws SQLException {
1658 // TODO Auto-generated method stub
1663 public void updateObject(String columnLabel, Object x) throws SQLException {
1664 // TODO Auto-generated method stub
1669 public void updateRef(int columnIndex, Ref x) throws SQLException {
1670 // TODO Auto-generated method stub
1675 public void updateRef(String columnLabel, Ref x) throws SQLException {
1676 // TODO Auto-generated method stub
1681 public void updateRow() throws SQLException {
1682 // TODO Auto-generated method stub
1687 public void updateRowId(int columnIndex, RowId x) throws SQLException {
1688 // TODO Auto-generated method stub
1693 public void updateRowId(String columnLabel, RowId x) throws SQLException {
1694 // TODO Auto-generated method stub
1699 public void updateSQLXML(int columnIndex, SQLXML xmlObject)
1700 throws SQLException {
1701 // TODO Auto-generated method stub
1706 public void updateSQLXML(String columnLabel, SQLXML xmlObject)
1707 throws SQLException {
1708 // TODO Auto-generated method stub
1713 public void updateShort(int columnIndex, short x) throws SQLException {
1714 // TODO Auto-generated method stub
1719 public void updateShort(String columnLabel, short x) throws SQLException {
1720 // TODO Auto-generated method stub
1725 public void updateString(int columnIndex, String x) throws SQLException {
1726 // TODO Auto-generated method stub
1731 public void updateString(String columnLabel, String x) throws SQLException {
1732 // TODO Auto-generated method stub
1737 public void updateTime(int columnIndex, Time x) throws SQLException {
1738 // TODO Auto-generated method stub
1743 public void updateTime(String columnLabel, Time x) throws SQLException {
1744 // TODO Auto-generated method stub
1749 public void updateTimestamp(int columnIndex, Timestamp x)
1750 throws SQLException {
1751 // TODO Auto-generated method stub
1756 public void updateTimestamp(String columnLabel, Timestamp x)
1757 throws SQLException {
1758 // TODO Auto-generated method stub
1763 public boolean wasNull() throws SQLException {
1764 // TODO Auto-generated method stub
1769 public String getCatalogName(int column) throws SQLException {
1770 // TODO Auto-generated method stub
1775 public String getColumnClassName(int column) throws SQLException {
1776 // TODO Auto-generated method stub
1781 public int getColumnCount() throws SQLException {
1782 return fieldsInQuery.size();
1786 public int getColumnDisplaySize(int column) throws SQLException {
1787 // TODO Auto-generated method stub
1792 public String getColumnLabel(int column) throws SQLException {
1793 return this.fieldsInQuery.get(column - 1).toString();
1797 public String getColumnName(int column) throws SQLException {
1798 // TODO Auto-generated method stub
1803 public int getColumnType(int column) throws SQLException {
1808 public String getColumnTypeName(int column) throws SQLException {
1809 // TODO Auto-generated method stub
1814 public int getPrecision(int column) throws SQLException {
1815 // TODO Auto-generated method stub
1820 public int getScale(int column) throws SQLException {
1821 // TODO Auto-generated method stub
1826 public String getSchemaName(int column) throws SQLException {
1827 // TODO Auto-generated method stub
1832 public String getTableName(int column) throws SQLException {
1833 // TODO Auto-generated method stub
1838 public boolean isAutoIncrement(int column) throws SQLException {
1839 // TODO Auto-generated method stub
1844 public boolean isCaseSensitive(int column) throws SQLException {
1845 // TODO Auto-generated method stub
1850 public boolean isCurrency(int column) throws SQLException {
1851 // TODO Auto-generated method stub
1856 public boolean isDefinitelyWritable(int column) throws SQLException {
1857 // TODO Auto-generated method stub
1862 public int isNullable(int column) throws SQLException {
1863 // TODO Auto-generated method stub
1868 public boolean isReadOnly(int column) throws SQLException {
1869 // TODO Auto-generated method stub
1874 public boolean isSearchable(int column) throws SQLException {
1875 // TODO Auto-generated method stub
1880 public boolean isSigned(int column) throws SQLException {
1881 // TODO Auto-generated method stub
1886 public boolean isWritable(int column) throws SQLException {
1887 // TODO Auto-generated method stub
1892 public <T> T getObject(int columnIndex, Class<T> type) throws SQLException {
1893 // TODO Auto-generated method stub
1898 public <T> T getObject(String columnLabel, Class<T> type)
1899 throws SQLException {
1900 // TODO Auto-generated method stub