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)
54 public class JDBCResultSet implements Serializable, ResultSet, ResultSetMetaData {
55 private static final long serialVersionUID = -7450200738431047057L;
56 private static final ClassLoader CLASS_LOADER = JDBCResultSet.class.getClassLoader();
57 private static final Class<?>[] PROXY_INTERFACES = new Class[] { ResultSet.class };
58 private static int nextID = 0;
60 private String sql = null;
61 private List<XSQLBluePrintNode> tablesInQuery = new ArrayList<>();
62 private Map<String, XSQLBluePrintNode> tablesInQueryMap = new ConcurrentHashMap<>();
63 private List<XSQLColumn> fieldsInQuery = new ArrayList<>();
64 private transient LinkedList<Map<String, Object>> records = new LinkedList<>();
65 private transient Map<String, Object> currentRecord = null;
66 private boolean finished = false;
68 public int numberOfTasks = 0;
69 private Map<String, Map<XSQLColumn, List<XSQLCriteria>>> criteria = new ConcurrentHashMap<>();
70 private Exception err = null;
71 private List<Record> EMPTY_RESULT = new LinkedList<>();
72 private transient Map<String, JDBCResultSet> subQueries = new HashMap<>();
74 public ResultSet getProxy() {
76 //return (ResultSet) Proxy.newProxyInstance(CLASS_LOADER, PROXY_INTERFACES, new JDBCProxy(this));
79 public void setSQL(String _sql) {
83 public JDBCResultSet addSubQuery(String _sql, String logicalName) {
84 if (subQueries == null) {
85 subQueries = new HashMap<>();
87 JDBCResultSet rs = new JDBCResultSet(_sql);
88 this.subQueries.put(logicalName, rs);
92 public Map<String, JDBCResultSet> getSubQueries() {
93 if (this.subQueries == null) {
94 this.subQueries = new HashMap<>();
96 return this.subQueries;
99 public JDBCResultSet(String _sql) {
100 synchronized (JDBCResultSet.class) {
107 public String getSQL() {
111 public void setError(Exception _err) {
115 public Exception getError() {
119 public void updateData(JDBCResultSet rs) {
120 synchronized (this) {
121 this.tablesInQuery = rs.tablesInQuery;
122 this.tablesInQueryMap = rs.tablesInQueryMap;
123 this.fieldsInQuery = rs.fieldsInQuery;
128 public int isObjectFitCriteria(Map<String, Object> objValues,
130 Map<XSQLColumn, List<XSQLCriteria>> tblCriteria = criteria
132 if (tblCriteria == null) {
135 for (Map.Entry<XSQLColumn, List<XSQLCriteria>> cc : tblCriteria
137 for (XSQLCriteria c : cc.getValue()) {
138 Object value = objValues.get(cc.getKey().toString());
139 int result = c.checkValue(value);
148 public int isObjectFitCriteria(Object element, Class<?> cls) {
149 Map<XSQLColumn, List<XSQLCriteria>> tblCriteria = criteria.get(cls
151 if (tblCriteria == null) {
154 for (Map.Entry<XSQLColumn, List<XSQLCriteria>> cc : tblCriteria
156 for (XSQLCriteria c : cc.getValue()) {
157 int result = c.isObjectFitCriteria(element, cc.getKey()
167 public Map<String, Map<XSQLColumn, List<XSQLCriteria>>> getCriteria() {
168 return this.criteria;
175 public List<XSQLBluePrintNode> getTables() {
176 return tablesInQuery;
179 public void addTableToQuery(XSQLBluePrintNode node) {
180 if (this.tablesInQueryMap.containsKey(node.getBluePrintNodeName())) {
183 this.tablesInQuery.add(node);
184 this.tablesInQueryMap.put(node.getBluePrintNodeName(), node);
187 public List<XSQLColumn> getFields() {
188 return this.fieldsInQuery;
191 public XSQLBluePrintNode getMainTable() {
192 if (tablesInQuery.size() == 1) {
193 return tablesInQuery.get(0);
195 XSQLBluePrintNode result = null;
196 for (XSQLBluePrintNode node : tablesInQuery) {
197 if (result == null) {
199 } else if (result.getLevel() < node.getLevel()) {
206 public boolean isFinished() {
210 public void setFinished(boolean b) {
215 return this.records.size();
218 public void addRecord(Map<String, Object> r) {
219 synchronized (this) {
220 if (records == null) {
221 records = new LinkedList<>();
228 public void addRecord(ArrayList<?> hierarchy) {
229 Map<String, Object> rec = new HashMap<>();
230 for (int i = hierarchy.size() - 1; i >= 0; i--) {
231 Object element = hierarchy.get(i);
232 for (XSQLColumn c : fieldsInQuery) {
233 if (c.getTableName().equals(element.getClass().getSimpleName())) {
235 Method m = element.getClass().getMethod(c.getName(),
237 Object value = m.invoke(element, null);
238 rec.put(c.getName(), value);
239 } catch (Exception err) {
240 err.printStackTrace();
245 this.records.add(rec);
248 public boolean next() {
249 this.currentRecord = null;
250 if (records == null) {
251 records = new LinkedList<>();
253 while (!finished || records.size() > 0) {
254 synchronized (this) {
255 if (records.size() == 0) {
258 } catch (Exception err) {
260 if (records.size() > 0) {
262 currentRecord = records.removeFirst();
270 currentRecord = records.removeFirst();
281 public Map<String, Object> getCurrent() {
282 return this.currentRecord;
285 private void createRecord(Object data, XSQLBluePrintNode node) {
286 Map<String, Object> rec = new HashMap<>();
287 for (XSQLColumn c : this.fieldsInQuery) {
288 if (c.getTableName().equals(node.getBluePrintNodeName())) {
290 Method m = node.getInterface().getMethod(c.getName(), null);
291 Object value = m.invoke(data, null);
293 rec.put(c.getName(), value);
295 rec.put(c.getName(), "");
297 } catch (Exception err) {
298 err.printStackTrace();
305 public static class Record {
306 // The map container the Attribute 2 the attribute value
307 public Map<String, Object> data = new HashMap<>();
308 // The Element Object (Possibly some kind of NormalizedNode
309 public Object element = null;
310 // Does this record fit the criteria
311 // In case of a list property, we first collect the list and only then
313 // we decide which list item should be included or not.
314 public boolean fitCriteria = true;
316 public Map<String, Object> getRecord() {
321 public static class RecordsContainer {
322 public List<Record> records = new LinkedList<>();
323 public List<Record> fitRecords = new LinkedList<>();
324 public Object currentObject = null;
327 private void collectColumnValues(RecordsContainer rContainer,
328 XSQLBluePrintNode bpn) {
329 Collection<?> subChildren = XSQLODLUtils
330 .getChildrenCollection(rContainer.currentObject);
331 Record r = new Record();
332 r.element = rContainer.currentObject;
333 for (Object stc : subChildren) {
334 if (stc.getClass().getName()
335 .endsWith("ImmutableUnkeyedListEntryNode")) {
336 r.fitCriteria = false;
337 rContainer.currentObject = stc;
338 collectColumnValues(rContainer, bpn);
339 } else if (stc.getClass().getName()
340 .endsWith("ImmutableAugmentationNode")) {
341 Map<?, ?> values = XSQLODLUtils.getChildren(stc);
342 for (Object key : values.keySet()) {
343 Object val = values.get(key);
344 if (val.getClass().getName().endsWith("ImmutableLeafNode")) {
345 Object value = XSQLODLUtils.getValue(val);
346 String k = XSQLODLUtils.getNodeName(val);
348 r.data.put(bpn.getBluePrintNodeName() + "." + k,
353 } else if (stc.getClass().getName().endsWith("ImmutableLeafNode")) {
354 String k = XSQLODLUtils.getNodeName(stc);
355 Object value = XSQLODLUtils.getValue(stc);
357 r.data.put(bpn.getBluePrintNodeName() + "." + k,
363 rContainer.records.add(r);
367 private void addToData(Record rec, XSQLBluePrintNode bpn,XSQLBluePrint bluePrint, Map<String, Object> fullRecord) {
368 XSQLBluePrintNode eNodes[] = bluePrint
369 .getBluePrintNodeByODLTableName(XSQLODLUtils
370 .getNodeIdentiofier(rec.element));
372 for (XSQLColumn c : fieldsInQuery) {
373 for (XSQLBluePrintNode eNode : eNodes) {
374 if (((XSQLBluePrintNode) c.getBluePrintNode())
375 .getBluePrintNodeName().equals(
376 eNode.getBluePrintNodeName())) {
377 // Object value = Criteria.getValue(rec.element,
379 String columnName = c.toString();
380 Object value = fullRecord.get(columnName);
383 Object rsValue = c.getResultSetValue(value);
384 c.setCharWidth(rsValue.toString().length());
385 rec.data.put(columnName, rsValue);
386 } catch (Exception err) {
395 private boolean beenHere(Set<String> beenHereElement, Object element) {
396 if (beenHereElement == null) {
397 beenHereElement = new HashSet<>();
400 String elementKey = null;
403 elementKey = element.toString();
404 } catch (Exception err) {
405 elementKey = "Unknown";
408 if (beenHereElement.contains(elementKey)) {
412 beenHereElement.add(elementKey);
416 public List<Object> getChildren(Object node, String tableName,
417 XSQLBluePrint bluePrint) {
419 List<Object> children = XSQLODLUtils.getMChildren(node);
420 List<Object> result = new LinkedList<>();
422 for (Object child : children) {
424 String odlNodeName = XSQLODLUtils.getNodeIdentiofier(child);
425 if (odlNodeName == null) {
426 if (child instanceof DataContainerNode) {
427 List<Object> augChidlren = getChildren(child, tableName,
429 result.addAll(augChidlren);
434 XSQLBluePrintNode eNodes[] = bluePrint
435 .getBluePrintNodeByODLTableName(odlNodeName);
436 if (eNodes == null) {
440 boolean match = false;
441 for (XSQLBluePrintNode enode : eNodes) {
442 if (tableName.startsWith(enode.toString())) {
452 if (child.getClass().getName().endsWith("ImmutableUnkeyedListNode")) {
454 } else if (child.getClass().getName()
455 .endsWith("ImmutableContainerNode")) {
457 } else if (child.getClass().getName()
458 .endsWith("ImmutableAugmentationNode")) {
459 List<Object> _children = XSQLODLUtils.getMChildren(child);
460 for (Object c : _children) {
461 if (c.getClass().getName()
462 .endsWith("ImmutableContainerNode")) {
466 } else if (child.getClass().getName().endsWith("ImmutableMapNode")) {
467 result.addAll(XSQLODLUtils.getMChildren(child));
469 XSQLAdapter.log("Missed Node Data OF Type="
470 + child.getClass().getName());
476 public List<Record> addRecords(Object element, XSQLBluePrintNode node,
477 boolean root, String tableName, XSQLBluePrint bluePrint) {
478 List<Record> result = new LinkedList<>();
479 String nodeID = XSQLODLUtils.getNodeIdentiofier(element);
480 if (node.getODLTableName().equals(nodeID)) {
481 XSQLBluePrintNode bluePrintNode = bluePrint
482 .getBluePrintNodeByODLTableName(nodeID)[0];
483 RecordsContainer rContainer = new RecordsContainer();
484 rContainer.currentObject = element;
485 XSQLBluePrintNode bpn = this.tablesInQueryMap.get(bluePrintNode
486 .getBluePrintNodeName());
487 if (this.criteria.containsKey(bluePrintNode.getBluePrintNodeName())
489 collectColumnValues(rContainer, bpn);
490 for (Record r : rContainer.records) {
491 if (!(isObjectFitCriteria(r.data,
492 bpn.getBluePrintNodeName()) == 1)) {
493 r.fitCriteria = false;
496 Record rec = new Record();
497 rec.element = r.element;
498 addToData(rec, bpn, bluePrint, r.data);
499 rContainer.fitRecords.add(rec);
502 if (rContainer.fitRecords.isEmpty())
505 if (rContainer.records.isEmpty()) {
506 Record rec = new Record();
507 rec.element = rContainer.currentObject;
514 for (Record rec : rContainer.fitRecords) {
525 XSQLBluePrintNode parent = node.getParent();
526 List<Record> subRecords = addRecords(element, parent, false, tableName,
528 for (Record subRec : subRecords) {
529 List<Object> subO = getChildren(subRec.element, tableName,
532 for (Object subData : subO) {
533 RecordsContainer rContainer = new RecordsContainer();
534 rContainer.currentObject = subData;
536 String recID = XSQLODLUtils
537 .getNodeIdentiofier(rContainer.currentObject);
538 XSQLBluePrintNode eNodes[] = bluePrint
539 .getBluePrintNodeByODLTableName(recID);
540 XSQLBluePrintNode bpn = null;
541 for (XSQLBluePrintNode eNode : eNodes) {
542 bpn = this.tablesInQueryMap.get(eNode
543 .getBluePrintNodeName());
549 collectColumnValues(rContainer, bpn);
550 for (Record r : rContainer.records) {
551 if ((isObjectFitCriteria(r.data,
552 bpn.getBluePrintNodeName()) == 1)) {
553 Record rec = new Record();
554 rec.data.putAll(subRec.data);
555 rec.element = r.element;
556 addToData(rec, bpn, bluePrint, r.data);
558 r.fitCriteria = false;
562 if (rContainer.records.isEmpty()) {
563 Record rec = new Record();
564 rec.data.putAll(subRec.data);
565 rec.element = rContainer.currentObject;
567 if (!rec.data.isEmpty()) {
574 for (Record r : rContainer.records) {
575 r.data.putAll(subRec.data);
578 if (!r.data.isEmpty()) {
594 public boolean isWrapperFor(Class<?> iface) throws SQLException {
595 // TODO Auto-generated method stub
600 public <T> T unwrap(Class<T> iface) throws SQLException {
601 // TODO Auto-generated method stub
606 public boolean absolute(int row) throws SQLException {
607 // TODO Auto-generated method stub
612 public void afterLast() throws SQLException {
613 // TODO Auto-generated method stub
618 public void beforeFirst() throws SQLException {
619 // TODO Auto-generated method stub
624 public void cancelRowUpdates() throws SQLException {
625 // TODO Auto-generated method stub
630 public void clearWarnings() throws SQLException {
631 // TODO Auto-generated method stub
636 public void close() throws SQLException {
637 // TODO Auto-generated method stub
642 public void deleteRow() throws SQLException {
643 // TODO Auto-generated method stub
648 public int findColumn(String columnLabel) throws SQLException {
649 // TODO Auto-generated method stub
654 public boolean first() throws SQLException {
655 // TODO Auto-generated method stub
660 public Array getArray(int columnIndex) throws SQLException {
661 // TODO Auto-generated method stub
666 public Array getArray(String columnLabel) throws SQLException {
667 // TODO Auto-generated method stub
672 public InputStream getAsciiStream(int columnIndex) throws SQLException {
673 // TODO Auto-generated method stub
678 public InputStream getAsciiStream(String columnLabel) throws SQLException {
679 // TODO Auto-generated method stub
684 public BigDecimal getBigDecimal(int columnIndex, int scale)
685 throws SQLException {
686 // TODO Auto-generated method stub
691 public BigDecimal getBigDecimal(int columnIndex) throws SQLException {
692 // TODO Auto-generated method stub
697 public BigDecimal getBigDecimal(String columnLabel, int scale)
698 throws SQLException {
699 // TODO Auto-generated method stub
704 public BigDecimal getBigDecimal(String columnLabel) throws SQLException {
705 // TODO Auto-generated method stub
710 public InputStream getBinaryStream(int columnIndex) throws SQLException {
711 // TODO Auto-generated method stub
716 public InputStream getBinaryStream(String columnLabel) throws SQLException {
717 // TODO Auto-generated method stub
722 public Blob getBlob(int columnIndex) throws SQLException {
723 // TODO Auto-generated method stub
728 public Blob getBlob(String columnLabel) throws SQLException {
729 // TODO Auto-generated method stub
734 public boolean getBoolean(int columnIndex) throws SQLException {
735 // TODO Auto-generated method stub
740 public boolean getBoolean(String columnLabel) throws SQLException {
741 // TODO Auto-generated method stub
746 public byte getByte(int columnIndex) throws SQLException {
747 // TODO Auto-generated method stub
752 public byte getByte(String columnLabel) throws SQLException {
753 // TODO Auto-generated method stub
758 public byte[] getBytes(int columnIndex) throws SQLException {
759 // TODO Auto-generated method stub
764 public byte[] getBytes(String columnLabel) throws SQLException {
765 // TODO Auto-generated method stub
770 public Reader getCharacterStream(int columnIndex) throws SQLException {
771 // TODO Auto-generated method stub
776 public Reader getCharacterStream(String columnLabel) throws SQLException {
777 // TODO Auto-generated method stub
782 public Clob getClob(int columnIndex) throws SQLException {
783 // TODO Auto-generated method stub
788 public Clob getClob(String columnLabel) throws SQLException {
789 // TODO Auto-generated method stub
794 public int getConcurrency() throws SQLException {
795 // TODO Auto-generated method stub
800 public String getCursorName() throws SQLException {
801 // TODO Auto-generated method stub
806 public Date getDate(int columnIndex, Calendar cal) throws SQLException {
807 // TODO Auto-generated method stub
812 public Date getDate(int columnIndex) throws SQLException {
813 // TODO Auto-generated method stub
818 public Date getDate(String columnLabel, Calendar cal) throws SQLException {
819 // TODO Auto-generated method stub
824 public Date getDate(String columnLabel) throws SQLException {
825 // TODO Auto-generated method stub
830 public double getDouble(int columnIndex) throws SQLException {
831 // TODO Auto-generated method stub
836 public double getDouble(String columnLabel) throws SQLException {
837 // TODO Auto-generated method stub
842 public int getFetchDirection() throws SQLException {
843 // TODO Auto-generated method stub
848 public int getFetchSize() throws SQLException {
849 // TODO Auto-generated method stub
854 public float getFloat(int columnIndex) throws SQLException {
855 // TODO Auto-generated method stub
860 public float getFloat(String columnLabel) throws SQLException {
861 // TODO Auto-generated method stub
866 public int getHoldability() throws SQLException {
867 // TODO Auto-generated method stub
872 public int getInt(int columnIndex) throws SQLException {
873 // TODO Auto-generated method stub
878 public int getInt(String columnLabel) throws SQLException {
879 // TODO Auto-generated method stub
884 public long getLong(int columnIndex) throws SQLException {
885 // TODO Auto-generated method stub
890 public long getLong(String columnLabel) throws SQLException {
891 // TODO Auto-generated method stub
896 public ResultSetMetaData getMetaData() throws SQLException {
901 public Reader getNCharacterStream(int columnIndex) throws SQLException {
902 // TODO Auto-generated method stub
907 public Reader getNCharacterStream(String columnLabel) throws SQLException {
908 // TODO Auto-generated method stub
913 public NClob getNClob(int columnIndex) throws SQLException {
914 // TODO Auto-generated method stub
919 public NClob getNClob(String columnLabel) throws SQLException {
920 // TODO Auto-generated method stub
925 public String getNString(int columnIndex) throws SQLException {
926 // TODO Auto-generated method stub
931 public String getNString(String columnLabel) throws SQLException {
932 // TODO Auto-generated method stub
937 public Object getObject(int columnIndex, Map<String, Class<?>> map)
938 throws SQLException {
939 return getObject(columnIndex);
943 public Object getObject(int columnIndex) throws SQLException {
944 return currentRecord.get(this.fieldsInQuery.get(columnIndex - 1)
949 public Object getObject(String columnLabel, Map<String, Class<?>> map)
950 throws SQLException {
951 return getObject(columnLabel);
955 public Object getObject(String columnLabel) throws SQLException {
956 return currentRecord.get(columnLabel);
960 public Ref getRef(int columnIndex) throws SQLException {
961 // TODO Auto-generated method stub
966 public Ref getRef(String columnLabel) throws SQLException {
967 // TODO Auto-generated method stub
972 public int getRow() throws SQLException {
973 // TODO Auto-generated method stub
978 public RowId getRowId(int columnIndex) throws SQLException {
979 // TODO Auto-generated method stub
984 public RowId getRowId(String columnLabel) throws SQLException {
985 // TODO Auto-generated method stub
990 public SQLXML getSQLXML(int columnIndex) throws SQLException {
991 // TODO Auto-generated method stub
996 public SQLXML getSQLXML(String columnLabel) throws SQLException {
997 // TODO Auto-generated method stub
1002 public short getShort(int columnIndex) throws SQLException {
1003 // TODO Auto-generated method stub
1008 public short getShort(String columnLabel) throws SQLException {
1009 // TODO Auto-generated method stub
1014 public Statement getStatement() throws SQLException {
1015 // TODO Auto-generated method stub
1020 public String getString(int columnIndex) throws SQLException {
1025 public String getString(String columnLabel) throws SQLException {
1030 public Time getTime(int columnIndex, Calendar cal) throws SQLException {
1031 // TODO Auto-generated method stub
1036 public Time getTime(int columnIndex) throws SQLException {
1037 // TODO Auto-generated method stub
1042 public Time getTime(String columnLabel, Calendar cal) throws SQLException {
1043 // TODO Auto-generated method stub
1048 public Time getTime(String columnLabel) throws SQLException {
1049 // TODO Auto-generated method stub
1054 public Timestamp getTimestamp(int columnIndex, Calendar cal)
1055 throws SQLException {
1056 // TODO Auto-generated method stub
1061 public Timestamp getTimestamp(int columnIndex) throws SQLException {
1062 // TODO Auto-generated method stub
1067 public Timestamp getTimestamp(String columnLabel, Calendar cal)
1068 throws SQLException {
1069 // TODO Auto-generated method stub
1074 public Timestamp getTimestamp(String columnLabel) throws SQLException {
1075 // TODO Auto-generated method stub
1080 public int getType() throws SQLException {
1081 return ResultSet.TYPE_FORWARD_ONLY;
1085 public URL getURL(int columnIndex) throws SQLException {
1086 // TODO Auto-generated method stub
1091 public URL getURL(String columnLabel) throws SQLException {
1092 // TODO Auto-generated method stub
1097 public InputStream getUnicodeStream(int columnIndex) throws SQLException {
1098 // TODO Auto-generated method stub
1103 public InputStream getUnicodeStream(String columnLabel) throws SQLException {
1104 // TODO Auto-generated method stub
1109 public SQLWarning getWarnings() throws SQLException {
1110 // TODO Auto-generated method stub
1115 public void insertRow() throws SQLException {
1116 // TODO Auto-generated method stub
1121 public boolean isAfterLast() throws SQLException {
1122 // TODO Auto-generated method stub
1127 public boolean isBeforeFirst() throws SQLException {
1128 // TODO Auto-generated method stub
1133 public boolean isClosed() throws SQLException {
1134 // TODO Auto-generated method stub
1139 public boolean isFirst() throws SQLException {
1140 // TODO Auto-generated method stub
1145 public boolean isLast() throws SQLException {
1146 // TODO Auto-generated method stub
1151 public boolean last() throws SQLException {
1152 // TODO Auto-generated method stub
1157 public void moveToCurrentRow() throws SQLException {
1158 // TODO Auto-generated method stub
1163 public void moveToInsertRow() throws SQLException {
1164 // TODO Auto-generated method stub
1169 public boolean previous() throws SQLException {
1170 // TODO Auto-generated method stub
1175 public void refreshRow() throws SQLException {
1176 // TODO Auto-generated method stub
1181 public boolean relative(int rows) throws SQLException {
1182 // TODO Auto-generated method stub
1187 public boolean rowDeleted() throws SQLException {
1188 // TODO Auto-generated method stub
1193 public boolean rowInserted() throws SQLException {
1194 // TODO Auto-generated method stub
1199 public boolean rowUpdated() throws SQLException {
1200 // TODO Auto-generated method stub
1205 public void setFetchDirection(int direction) throws SQLException {
1206 // TODO Auto-generated method stub
1211 public void setFetchSize(int rows) throws SQLException {
1212 // TODO Auto-generated method stub
1217 public void updateArray(int columnIndex, Array x) throws SQLException {
1218 // TODO Auto-generated method stub
1223 public void updateArray(String columnLabel, Array x) throws SQLException {
1224 // TODO Auto-generated method stub
1229 public void updateAsciiStream(int columnIndex, InputStream x, int length)
1230 throws SQLException {
1231 // TODO Auto-generated method stub
1236 public void updateAsciiStream(int columnIndex, InputStream x, long length)
1237 throws SQLException {
1238 // TODO Auto-generated method stub
1243 public void updateAsciiStream(int columnIndex, InputStream x)
1244 throws SQLException {
1245 // TODO Auto-generated method stub
1250 public void updateAsciiStream(String columnLabel, InputStream x, int length)
1251 throws SQLException {
1252 // TODO Auto-generated method stub
1257 public void updateAsciiStream(String columnLabel, InputStream x, long length)
1258 throws SQLException {
1259 // TODO Auto-generated method stub
1264 public void updateAsciiStream(String columnLabel, InputStream x)
1265 throws SQLException {
1266 // TODO Auto-generated method stub
1271 public void updateBigDecimal(int columnIndex, BigDecimal x)
1272 throws SQLException {
1273 // TODO Auto-generated method stub
1278 public void updateBigDecimal(String columnLabel, BigDecimal x)
1279 throws SQLException {
1280 // TODO Auto-generated method stub
1285 public void updateBinaryStream(int columnIndex, InputStream x, int length)
1286 throws SQLException {
1287 // TODO Auto-generated method stub
1292 public void updateBinaryStream(int columnIndex, InputStream x, long length)
1293 throws SQLException {
1294 // TODO Auto-generated method stub
1299 public void updateBinaryStream(int columnIndex, InputStream x)
1300 throws SQLException {
1301 // TODO Auto-generated method stub
1306 public void updateBinaryStream(String columnLabel, InputStream x, int length)
1307 throws SQLException {
1308 // TODO Auto-generated method stub
1313 public void updateBinaryStream(String columnLabel, InputStream x,
1314 long length) throws SQLException {
1315 // TODO Auto-generated method stub
1320 public void updateBinaryStream(String columnLabel, InputStream x)
1321 throws SQLException {
1322 // TODO Auto-generated method stub
1327 public void updateBlob(int columnIndex, Blob x) throws SQLException {
1328 // TODO Auto-generated method stub
1333 public void updateBlob(int columnIndex, InputStream inputStream, long length)
1334 throws SQLException {
1335 // TODO Auto-generated method stub
1340 public void updateBlob(int columnIndex, InputStream inputStream)
1341 throws SQLException {
1342 // TODO Auto-generated method stub
1347 public void updateBlob(String columnLabel, Blob x) throws SQLException {
1348 // TODO Auto-generated method stub
1353 public void updateBlob(String columnLabel, InputStream inputStream,
1354 long length) throws SQLException {
1355 // TODO Auto-generated method stub
1360 public void updateBlob(String columnLabel, InputStream inputStream)
1361 throws SQLException {
1362 // TODO Auto-generated method stub
1367 public void updateBoolean(int columnIndex, boolean x) throws SQLException {
1368 // TODO Auto-generated method stub
1373 public void updateBoolean(String columnLabel, boolean x)
1374 throws SQLException {
1375 // TODO Auto-generated method stub
1380 public void updateByte(int columnIndex, byte x) throws SQLException {
1381 // TODO Auto-generated method stub
1386 public void updateByte(String columnLabel, byte x) throws SQLException {
1387 // TODO Auto-generated method stub
1392 public void updateBytes(int columnIndex, byte[] x) throws SQLException {
1393 // TODO Auto-generated method stub
1398 public void updateBytes(String columnLabel, byte[] x) throws SQLException {
1399 // TODO Auto-generated method stub
1404 public void updateCharacterStream(int columnIndex, Reader x, int length)
1405 throws SQLException {
1406 // TODO Auto-generated method stub
1411 public void updateCharacterStream(int columnIndex, Reader x, long length)
1412 throws SQLException {
1413 // TODO Auto-generated method stub
1418 public void updateCharacterStream(int columnIndex, Reader x)
1419 throws SQLException {
1420 // TODO Auto-generated method stub
1425 public void updateCharacterStream(String columnLabel, Reader reader,
1426 int length) throws SQLException {
1427 // TODO Auto-generated method stub
1432 public void updateCharacterStream(String columnLabel, Reader reader,
1433 long length) throws SQLException {
1434 // TODO Auto-generated method stub
1439 public void updateCharacterStream(String columnLabel, Reader reader)
1440 throws SQLException {
1441 // TODO Auto-generated method stub
1446 public void updateClob(int columnIndex, Clob x) throws SQLException {
1447 // TODO Auto-generated method stub
1452 public void updateClob(int columnIndex, Reader reader, long length)
1453 throws SQLException {
1454 // TODO Auto-generated method stub
1459 public void updateClob(int columnIndex, Reader reader) throws SQLException {
1460 // TODO Auto-generated method stub
1465 public void updateClob(String columnLabel, Clob x) throws SQLException {
1466 // TODO Auto-generated method stub
1471 public void updateClob(String columnLabel, Reader reader, long length)
1472 throws SQLException {
1473 // TODO Auto-generated method stub
1478 public void updateClob(String columnLabel, Reader reader)
1479 throws SQLException {
1480 // TODO Auto-generated method stub
1485 public void updateDate(int columnIndex, Date x) throws SQLException {
1486 // TODO Auto-generated method stub
1491 public void updateDate(String columnLabel, Date x) throws SQLException {
1492 // TODO Auto-generated method stub
1497 public void updateDouble(int columnIndex, double x) throws SQLException {
1498 // TODO Auto-generated method stub
1503 public void updateDouble(String columnLabel, double x) throws SQLException {
1504 // TODO Auto-generated method stub
1509 public void updateFloat(int columnIndex, float x) throws SQLException {
1510 // TODO Auto-generated method stub
1515 public void updateFloat(String columnLabel, float x) throws SQLException {
1516 // TODO Auto-generated method stub
1521 public void updateInt(int columnIndex, int x) throws SQLException {
1522 // TODO Auto-generated method stub
1527 public void updateInt(String columnLabel, int x) throws SQLException {
1528 // TODO Auto-generated method stub
1533 public void updateLong(int columnIndex, long x) throws SQLException {
1534 // TODO Auto-generated method stub
1539 public void updateLong(String columnLabel, long x) throws SQLException {
1540 // TODO Auto-generated method stub
1545 public void updateNCharacterStream(int columnIndex, Reader x, long length)
1546 throws SQLException {
1547 // TODO Auto-generated method stub
1552 public void updateNCharacterStream(int columnIndex, Reader x)
1553 throws SQLException {
1554 // TODO Auto-generated method stub
1559 public void updateNCharacterStream(String columnLabel, Reader reader,
1560 long length) throws SQLException {
1561 // TODO Auto-generated method stub
1566 public void updateNCharacterStream(String columnLabel, Reader reader)
1567 throws SQLException {
1568 // TODO Auto-generated method stub
1573 public void updateNClob(int columnIndex, NClob nClob) throws SQLException {
1574 // TODO Auto-generated method stub
1579 public void updateNClob(int columnIndex, Reader reader, long length)
1580 throws SQLException {
1581 // TODO Auto-generated method stub
1586 public void updateNClob(int columnIndex, Reader reader) throws SQLException {
1587 // TODO Auto-generated method stub
1592 public void updateNClob(String columnLabel, NClob nClob)
1593 throws SQLException {
1594 // TODO Auto-generated method stub
1599 public void updateNClob(String columnLabel, Reader reader, long length)
1600 throws SQLException {
1601 // TODO Auto-generated method stub
1606 public void updateNClob(String columnLabel, Reader reader)
1607 throws SQLException {
1608 // TODO Auto-generated method stub
1613 public void updateNString(int columnIndex, String nString)
1614 throws SQLException {
1615 // TODO Auto-generated method stub
1620 public void updateNString(String columnLabel, String nString)
1621 throws SQLException {
1622 // TODO Auto-generated method stub
1627 public void updateNull(int columnIndex) throws SQLException {
1628 // TODO Auto-generated method stub
1633 public void updateNull(String columnLabel) throws SQLException {
1634 // TODO Auto-generated method stub
1639 public void updateObject(int columnIndex, Object x, int scaleOrLength)
1640 throws SQLException {
1641 // TODO Auto-generated method stub
1646 public void updateObject(int columnIndex, Object x) throws SQLException {
1647 // TODO Auto-generated method stub
1652 public void updateObject(String columnLabel, Object x, int scaleOrLength)
1653 throws SQLException {
1654 // TODO Auto-generated method stub
1659 public void updateObject(String columnLabel, Object x) throws SQLException {
1660 // TODO Auto-generated method stub
1665 public void updateRef(int columnIndex, Ref x) throws SQLException {
1666 // TODO Auto-generated method stub
1671 public void updateRef(String columnLabel, Ref x) throws SQLException {
1672 // TODO Auto-generated method stub
1677 public void updateRow() throws SQLException {
1678 // TODO Auto-generated method stub
1683 public void updateRowId(int columnIndex, RowId x) throws SQLException {
1684 // TODO Auto-generated method stub
1689 public void updateRowId(String columnLabel, RowId x) throws SQLException {
1690 // TODO Auto-generated method stub
1695 public void updateSQLXML(int columnIndex, SQLXML xmlObject)
1696 throws SQLException {
1697 // TODO Auto-generated method stub
1702 public void updateSQLXML(String columnLabel, SQLXML xmlObject)
1703 throws SQLException {
1704 // TODO Auto-generated method stub
1709 public void updateShort(int columnIndex, short x) throws SQLException {
1710 // TODO Auto-generated method stub
1715 public void updateShort(String columnLabel, short x) throws SQLException {
1716 // TODO Auto-generated method stub
1721 public void updateString(int columnIndex, String x) throws SQLException {
1722 // TODO Auto-generated method stub
1727 public void updateString(String columnLabel, String x) throws SQLException {
1728 // TODO Auto-generated method stub
1733 public void updateTime(int columnIndex, Time x) throws SQLException {
1734 // TODO Auto-generated method stub
1739 public void updateTime(String columnLabel, Time x) throws SQLException {
1740 // TODO Auto-generated method stub
1745 public void updateTimestamp(int columnIndex, Timestamp x)
1746 throws SQLException {
1747 // TODO Auto-generated method stub
1752 public void updateTimestamp(String columnLabel, Timestamp x)
1753 throws SQLException {
1754 // TODO Auto-generated method stub
1759 public boolean wasNull() throws SQLException {
1760 // TODO Auto-generated method stub
1765 public String getCatalogName(int column) throws SQLException {
1766 // TODO Auto-generated method stub
1771 public String getColumnClassName(int column) throws SQLException {
1772 // TODO Auto-generated method stub
1777 public int getColumnCount() throws SQLException {
1778 return fieldsInQuery.size();
1782 public int getColumnDisplaySize(int column) throws SQLException {
1783 // TODO Auto-generated method stub
1788 public String getColumnLabel(int column) throws SQLException {
1789 return this.fieldsInQuery.get(column - 1).toString();
1793 public String getColumnName(int column) throws SQLException {
1794 // TODO Auto-generated method stub
1799 public int getColumnType(int column) throws SQLException {
1804 public String getColumnTypeName(int column) throws SQLException {
1805 // TODO Auto-generated method stub
1810 public int getPrecision(int column) throws SQLException {
1811 // TODO Auto-generated method stub
1816 public int getScale(int column) throws SQLException {
1817 // TODO Auto-generated method stub
1822 public String getSchemaName(int column) throws SQLException {
1823 // TODO Auto-generated method stub
1828 public String getTableName(int column) throws SQLException {
1829 // TODO Auto-generated method stub
1834 public boolean isAutoIncrement(int column) throws SQLException {
1835 // TODO Auto-generated method stub
1840 public boolean isCaseSensitive(int column) throws SQLException {
1841 // TODO Auto-generated method stub
1846 public boolean isCurrency(int column) throws SQLException {
1847 // TODO Auto-generated method stub
1852 public boolean isDefinitelyWritable(int column) throws SQLException {
1853 // TODO Auto-generated method stub
1858 public int isNullable(int column) throws SQLException {
1859 // TODO Auto-generated method stub
1864 public boolean isReadOnly(int column) throws SQLException {
1865 // TODO Auto-generated method stub
1870 public boolean isSearchable(int column) throws SQLException {
1871 // TODO Auto-generated method stub
1876 public boolean isSigned(int column) throws SQLException {
1877 // TODO Auto-generated method stub
1882 public boolean isWritable(int column) throws SQLException {
1883 // TODO Auto-generated method stub
1888 public <T> T getObject(int columnIndex, Class<T> type) throws SQLException {
1889 // TODO Auto-generated method stub
1894 public <T> T getObject(String columnLabel, Class<T> type)
1895 throws SQLException {
1896 // TODO Auto-generated method stub