2 * Copyright (c) 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
8 package org.opendaylight.controller.md.sal.dom.xsql;
10 import java.io.InputStream;
11 import java.io.Reader;
12 import java.math.BigDecimal;
14 import java.sql.Array;
18 import java.sql.NClob;
20 import java.sql.ResultSet;
21 import java.sql.ResultSetMetaData;
22 import java.sql.RowId;
23 import java.sql.SQLException;
24 import java.sql.SQLWarning;
25 import java.sql.SQLXML;
26 import java.sql.Statement;
28 import java.sql.Timestamp;
29 import java.util.Calendar;
32 * @author Sharon Aicler(saichler@gmail.com)
35 * To be removed in Nitrogen
38 public class TablesResultSet implements ResultSet {
40 private String tables[] = null;
43 public TablesResultSet(XSQLBluePrint cache) {
44 //tables = cache.getInterfaceNames();
48 public <T> T unwrap(Class<T> iface) throws SQLException {
49 // TODO Auto-generated method stub
54 public boolean isWrapperFor(Class<?> iface) throws SQLException {
55 // TODO Auto-generated method stub
60 public boolean next() throws SQLException {
65 if (pos >= tables.length) {
72 public void close() throws SQLException {
73 // TODO Auto-generated method stub
78 public boolean wasNull() throws SQLException {
79 // TODO Auto-generated method stub
84 public String getString(int columnIndex) throws SQLException {
89 public boolean getBoolean(int columnIndex) throws SQLException {
90 // TODO Auto-generated method stub
95 public byte getByte(int columnIndex) throws SQLException {
96 // TODO Auto-generated method stub
101 public short getShort(int columnIndex) throws SQLException {
102 // TODO Auto-generated method stub
107 public int getInt(int columnIndex) throws SQLException {
108 // TODO Auto-generated method stub
113 public long getLong(int columnIndex) throws SQLException {
114 // TODO Auto-generated method stub
119 public float getFloat(int columnIndex) throws SQLException {
120 // TODO Auto-generated method stub
125 public double getDouble(int columnIndex) throws SQLException {
126 // TODO Auto-generated method stub
131 public BigDecimal getBigDecimal(int columnIndex, int scale)
132 throws SQLException {
133 // TODO Auto-generated method stub
138 public byte[] getBytes(int columnIndex) throws SQLException {
139 // TODO Auto-generated method stub
144 public Date getDate(int columnIndex) throws SQLException {
145 // TODO Auto-generated method stub
150 public Time getTime(int columnIndex) throws SQLException {
151 // TODO Auto-generated method stub
156 public Timestamp getTimestamp(int columnIndex) throws SQLException {
157 // TODO Auto-generated method stub
162 public InputStream getAsciiStream(int columnIndex) throws SQLException {
163 // TODO Auto-generated method stub
168 public InputStream getUnicodeStream(int columnIndex) throws SQLException {
169 // TODO Auto-generated method stub
174 public InputStream getBinaryStream(int columnIndex) throws SQLException {
175 // TODO Auto-generated method stub
180 public String getString(String columnLabel) throws SQLException {
185 public boolean getBoolean(String columnLabel) throws SQLException {
186 // TODO Auto-generated method stub
191 public byte getByte(String columnLabel) throws SQLException {
192 // TODO Auto-generated method stub
197 public short getShort(String columnLabel) throws SQLException {
198 // TODO Auto-generated method stub
203 public int getInt(String columnLabel) throws SQLException {
204 // TODO Auto-generated method stub
209 public long getLong(String columnLabel) throws SQLException {
210 // TODO Auto-generated method stub
215 public float getFloat(String columnLabel) throws SQLException {
216 // TODO Auto-generated method stub
221 public double getDouble(String columnLabel) throws SQLException {
222 // TODO Auto-generated method stub
227 public BigDecimal getBigDecimal(String columnLabel, int scale)
228 throws SQLException {
229 // TODO Auto-generated method stub
234 public byte[] getBytes(String columnLabel) throws SQLException {
235 // TODO Auto-generated method stub
240 public Date getDate(String columnLabel) throws SQLException {
241 // TODO Auto-generated method stub
246 public Time getTime(String columnLabel) throws SQLException {
247 // TODO Auto-generated method stub
252 public Timestamp getTimestamp(String columnLabel) throws SQLException {
253 // TODO Auto-generated method stub
258 public InputStream getAsciiStream(String columnLabel) throws SQLException {
259 // TODO Auto-generated method stub
264 public InputStream getUnicodeStream(String columnLabel)
265 throws SQLException {
266 // TODO Auto-generated method stub
271 public InputStream getBinaryStream(String columnLabel) throws SQLException {
272 // TODO Auto-generated method stub
277 public SQLWarning getWarnings() throws SQLException {
278 // TODO Auto-generated method stub
283 public void clearWarnings() throws SQLException {
284 // TODO Auto-generated method stub
289 public String getCursorName() throws SQLException {
290 // TODO Auto-generated method stub
295 public ResultSetMetaData getMetaData() throws SQLException {
296 // TODO Auto-generated method stub
301 public Object getObject(int columnIndex) throws SQLException {
302 // TODO Auto-generated method stub
307 public Object getObject(String columnLabel) throws SQLException {
308 // TODO Auto-generated method stub
313 public int findColumn(String columnLabel) throws SQLException {
314 // TODO Auto-generated method stub
319 public Reader getCharacterStream(int columnIndex) throws SQLException {
320 // TODO Auto-generated method stub
325 public Reader getCharacterStream(String columnLabel) throws SQLException {
326 // TODO Auto-generated method stub
331 public BigDecimal getBigDecimal(int columnIndex) throws SQLException {
332 // TODO Auto-generated method stub
337 public BigDecimal getBigDecimal(String columnLabel) throws SQLException {
338 // TODO Auto-generated method stub
343 public boolean isBeforeFirst() throws SQLException {
344 // TODO Auto-generated method stub
349 public boolean isAfterLast() throws SQLException {
350 // TODO Auto-generated method stub
355 public boolean isFirst() throws SQLException {
356 // TODO Auto-generated method stub
361 public boolean isLast() throws SQLException {
362 // TODO Auto-generated method stub
367 public void beforeFirst() throws SQLException {
368 // TODO Auto-generated method stub
373 public void afterLast() throws SQLException {
374 // TODO Auto-generated method stub
379 public boolean first() throws SQLException {
380 // TODO Auto-generated method stub
385 public boolean last() throws SQLException {
386 // TODO Auto-generated method stub
391 public int getRow() throws SQLException {
392 // TODO Auto-generated method stub
397 public boolean absolute(int row) throws SQLException {
398 // TODO Auto-generated method stub
403 public boolean relative(int rows) throws SQLException {
404 // TODO Auto-generated method stub
409 public boolean previous() throws SQLException {
410 // TODO Auto-generated method stub
415 public void setFetchDirection(int direction) throws SQLException {
416 // TODO Auto-generated method stub
421 public int getFetchDirection() throws SQLException {
422 // TODO Auto-generated method stub
427 public void setFetchSize(int rows) throws SQLException {
428 // TODO Auto-generated method stub
433 public int getFetchSize() throws SQLException {
434 // TODO Auto-generated method stub
439 public int getType() throws SQLException {
440 // TODO Auto-generated method stub
445 public int getConcurrency() throws SQLException {
446 // TODO Auto-generated method stub
451 public boolean rowUpdated() throws SQLException {
452 // TODO Auto-generated method stub
457 public boolean rowInserted() throws SQLException {
458 // TODO Auto-generated method stub
463 public boolean rowDeleted() throws SQLException {
464 // TODO Auto-generated method stub
469 public void updateNull(int columnIndex) throws SQLException {
470 // TODO Auto-generated method stub
475 public void updateBoolean(int columnIndex, boolean x) throws SQLException {
476 // TODO Auto-generated method stub
481 public void updateByte(int columnIndex, byte x) throws SQLException {
482 // TODO Auto-generated method stub
487 public void updateShort(int columnIndex, short x) throws SQLException {
488 // TODO Auto-generated method stub
493 public void updateInt(int columnIndex, int x) throws SQLException {
494 // TODO Auto-generated method stub
499 public void updateLong(int columnIndex, long x) throws SQLException {
500 // TODO Auto-generated method stub
505 public void updateFloat(int columnIndex, float x) throws SQLException {
506 // TODO Auto-generated method stub
511 public void updateDouble(int columnIndex, double x) throws SQLException {
512 // TODO Auto-generated method stub
517 public void updateBigDecimal(int columnIndex, BigDecimal x)
518 throws SQLException {
519 // TODO Auto-generated method stub
524 public void updateString(int columnIndex, String x) throws SQLException {
525 // TODO Auto-generated method stub
530 public void updateBytes(int columnIndex, byte[] x) throws SQLException {
531 // TODO Auto-generated method stub
536 public void updateDate(int columnIndex, Date x) throws SQLException {
537 // TODO Auto-generated method stub
542 public void updateTime(int columnIndex, Time x) throws SQLException {
543 // TODO Auto-generated method stub
548 public void updateTimestamp(int columnIndex, Timestamp x)
549 throws SQLException {
550 // TODO Auto-generated method stub
555 public void updateAsciiStream(int columnIndex, InputStream x, int length)
556 throws SQLException {
557 // TODO Auto-generated method stub
562 public void updateBinaryStream(int columnIndex, InputStream x, int length)
563 throws SQLException {
564 // TODO Auto-generated method stub
569 public void updateCharacterStream(int columnIndex, Reader x, int length)
570 throws SQLException {
571 // TODO Auto-generated method stub
576 public void updateObject(int columnIndex, Object x, int scaleOrLength)
577 throws SQLException {
578 // TODO Auto-generated method stub
583 public void updateObject(int columnIndex, Object x) throws SQLException {
584 // TODO Auto-generated method stub
589 public void updateNull(String columnLabel) throws SQLException {
590 // TODO Auto-generated method stub
595 public void updateBoolean(String columnLabel, boolean x)
596 throws SQLException {
597 // TODO Auto-generated method stub
602 public void updateByte(String columnLabel, byte x) throws SQLException {
603 // TODO Auto-generated method stub
608 public void updateShort(String columnLabel, short x) throws SQLException {
609 // TODO Auto-generated method stub
614 public void updateInt(String columnLabel, int x) throws SQLException {
615 // TODO Auto-generated method stub
620 public void updateLong(String columnLabel, long x) throws SQLException {
621 // TODO Auto-generated method stub
626 public void updateFloat(String columnLabel, float x) throws SQLException {
627 // TODO Auto-generated method stub
632 public void updateDouble(String columnLabel, double x) throws SQLException {
633 // TODO Auto-generated method stub
638 public void updateBigDecimal(String columnLabel, BigDecimal x)
639 throws SQLException {
640 // TODO Auto-generated method stub
645 public void updateString(String columnLabel, String x) throws SQLException {
646 // TODO Auto-generated method stub
651 public void updateBytes(String columnLabel, byte[] x) throws SQLException {
652 // TODO Auto-generated method stub
657 public void updateDate(String columnLabel, Date x) throws SQLException {
658 // TODO Auto-generated method stub
663 public void updateTime(String columnLabel, Time x) throws SQLException {
664 // TODO Auto-generated method stub
669 public void updateTimestamp(String columnLabel, Timestamp x)
670 throws SQLException {
671 // TODO Auto-generated method stub
676 public void updateAsciiStream(String columnLabel, InputStream x, int length)
677 throws SQLException {
678 // TODO Auto-generated method stub
683 public void updateBinaryStream(String columnLabel, InputStream x,
685 throws SQLException {
686 // TODO Auto-generated method stub
691 public void updateCharacterStream(String columnLabel, Reader reader,
692 int length) throws SQLException {
693 // TODO Auto-generated method stub
698 public void updateObject(String columnLabel, Object x, int scaleOrLength)
699 throws SQLException {
700 // TODO Auto-generated method stub
705 public void updateObject(String columnLabel, Object x) throws SQLException {
706 // TODO Auto-generated method stub
711 public void insertRow() throws SQLException {
712 // TODO Auto-generated method stub
717 public void updateRow() throws SQLException {
718 // TODO Auto-generated method stub
723 public void deleteRow() throws SQLException {
724 // TODO Auto-generated method stub
729 public void refreshRow() throws SQLException {
730 // TODO Auto-generated method stub
735 public void cancelRowUpdates() throws SQLException {
736 // TODO Auto-generated method stub
741 public void moveToInsertRow() throws SQLException {
742 // TODO Auto-generated method stub
747 public void moveToCurrentRow() throws SQLException {
748 // TODO Auto-generated method stub
753 public Statement getStatement() throws SQLException {
754 // TODO Auto-generated method stub
759 public Object getObject(int columnIndex, Map<String, Class<?>> map)
760 throws SQLException {
761 // TODO Auto-generated method stub
766 public Ref getRef(int columnIndex) throws SQLException {
767 // TODO Auto-generated method stub
772 public Blob getBlob(int columnIndex) throws SQLException {
773 // TODO Auto-generated method stub
778 public Clob getClob(int columnIndex) throws SQLException {
779 // TODO Auto-generated method stub
784 public Array getArray(int columnIndex) throws SQLException {
785 // TODO Auto-generated method stub
790 public Object getObject(String columnLabel, Map<String, Class<?>> map)
791 throws SQLException {
792 // TODO Auto-generated method stub
797 public Ref getRef(String columnLabel) throws SQLException {
798 // TODO Auto-generated method stub
803 public Blob getBlob(String columnLabel) throws SQLException {
804 // TODO Auto-generated method stub
809 public Clob getClob(String columnLabel) throws SQLException {
810 // TODO Auto-generated method stub
815 public Array getArray(String columnLabel) throws SQLException {
816 // TODO Auto-generated method stub
821 public Date getDate(int columnIndex, Calendar cal) throws SQLException {
822 // TODO Auto-generated method stub
827 public Date getDate(String columnLabel, Calendar cal) throws SQLException {
828 // TODO Auto-generated method stub
833 public Time getTime(int columnIndex, Calendar cal) throws SQLException {
834 // TODO Auto-generated method stub
839 public Time getTime(String columnLabel, Calendar cal) throws SQLException {
840 // TODO Auto-generated method stub
845 public Timestamp getTimestamp(int columnIndex, Calendar cal)
846 throws SQLException {
847 // TODO Auto-generated method stub
852 public Timestamp getTimestamp(String columnLabel, Calendar cal)
853 throws SQLException {
854 // TODO Auto-generated method stub
859 public URL getURL(int columnIndex) throws SQLException {
860 // TODO Auto-generated method stub
865 public URL getURL(String columnLabel) throws SQLException {
866 // TODO Auto-generated method stub
871 public void updateRef(int columnIndex, Ref x) throws SQLException {
872 // TODO Auto-generated method stub
877 public void updateRef(String columnLabel, Ref x) throws SQLException {
878 // TODO Auto-generated method stub
883 public void updateBlob(int columnIndex, Blob x) throws SQLException {
884 // TODO Auto-generated method stub
889 public void updateBlob(String columnLabel, Blob x) throws SQLException {
890 // TODO Auto-generated method stub
895 public void updateClob(int columnIndex, Clob x) throws SQLException {
896 // TODO Auto-generated method stub
901 public void updateClob(String columnLabel, Clob x) throws SQLException {
902 // TODO Auto-generated method stub
907 public void updateArray(int columnIndex, Array x) throws SQLException {
908 // TODO Auto-generated method stub
913 public void updateArray(String columnLabel, Array x) throws SQLException {
914 // TODO Auto-generated method stub
919 public RowId getRowId(int columnIndex) throws SQLException {
920 // TODO Auto-generated method stub
925 public RowId getRowId(String columnLabel) throws SQLException {
926 // TODO Auto-generated method stub
931 public void updateRowId(int columnIndex, RowId x) throws SQLException {
932 // TODO Auto-generated method stub
937 public void updateRowId(String columnLabel, RowId x) throws SQLException {
938 // TODO Auto-generated method stub
943 public int getHoldability() throws SQLException {
944 // TODO Auto-generated method stub
949 public boolean isClosed() throws SQLException {
950 // TODO Auto-generated method stub
955 public void updateNString(int columnIndex, String nString)
956 throws SQLException {
957 // TODO Auto-generated method stub
962 public void updateNString(String columnLabel, String nString)
963 throws SQLException {
964 // TODO Auto-generated method stub
969 public void updateNClob(int columnIndex, NClob nClob) throws SQLException {
970 // TODO Auto-generated method stub
975 public void updateNClob(String columnLabel, NClob nClob)
976 throws SQLException {
977 // TODO Auto-generated method stub
982 public NClob getNClob(int columnIndex) throws SQLException {
983 // TODO Auto-generated method stub
988 public NClob getNClob(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 void updateSQLXML(int columnIndex, SQLXML xmlObject)
1007 throws SQLException {
1008 // TODO Auto-generated method stub
1013 public void updateSQLXML(String columnLabel, SQLXML xmlObject)
1014 throws SQLException {
1015 // TODO Auto-generated method stub
1020 public String getNString(int columnIndex) throws SQLException {
1021 // TODO Auto-generated method stub
1026 public String getNString(String columnLabel) throws SQLException {
1027 // TODO Auto-generated method stub
1032 public Reader getNCharacterStream(int columnIndex) throws SQLException {
1033 // TODO Auto-generated method stub
1038 public Reader getNCharacterStream(String columnLabel) throws SQLException {
1039 // TODO Auto-generated method stub
1044 public void updateNCharacterStream(int columnIndex, Reader x, long length)
1045 throws SQLException {
1046 // TODO Auto-generated method stub
1051 public void updateNCharacterStream(String columnLabel, Reader reader,
1052 long length) throws SQLException {
1053 // TODO Auto-generated method stub
1058 public void updateAsciiStream(int columnIndex, InputStream x, long length)
1059 throws SQLException {
1060 // TODO Auto-generated method stub
1065 public void updateBinaryStream(int columnIndex, InputStream x, long length)
1066 throws SQLException {
1067 // TODO Auto-generated method stub
1072 public void updateCharacterStream(int columnIndex, Reader x, long length)
1073 throws SQLException {
1074 // TODO Auto-generated method stub
1079 public void updateAsciiStream(String columnLabel, InputStream x,
1081 throws SQLException {
1082 // TODO Auto-generated method stub
1087 public void updateBinaryStream(String columnLabel, InputStream x,
1088 long length) throws SQLException {
1089 // TODO Auto-generated method stub
1094 public void updateCharacterStream(String columnLabel, Reader reader,
1095 long length) throws SQLException {
1096 // TODO Auto-generated method stub
1101 public void updateBlob(int columnIndex, InputStream inputStream,
1103 throws SQLException {
1104 // TODO Auto-generated method stub
1109 public void updateBlob(String columnLabel, InputStream inputStream,
1110 long length) throws SQLException {
1111 // TODO Auto-generated method stub
1116 public void updateClob(int columnIndex, Reader reader, long length)
1117 throws SQLException {
1118 // TODO Auto-generated method stub
1123 public void updateClob(String columnLabel, Reader reader, long length)
1124 throws SQLException {
1125 // TODO Auto-generated method stub
1130 public void updateNClob(int columnIndex, Reader reader, long length)
1131 throws SQLException {
1132 // TODO Auto-generated method stub
1137 public void updateNClob(String columnLabel, Reader reader, long length)
1138 throws SQLException {
1139 // TODO Auto-generated method stub
1144 public void updateNCharacterStream(int columnIndex, Reader x)
1145 throws SQLException {
1146 // TODO Auto-generated method stub
1151 public void updateNCharacterStream(String columnLabel, Reader reader)
1152 throws SQLException {
1153 // TODO Auto-generated method stub
1158 public void updateAsciiStream(int columnIndex, InputStream x)
1159 throws SQLException {
1160 // TODO Auto-generated method stub
1165 public void updateBinaryStream(int columnIndex, InputStream x)
1166 throws SQLException {
1167 // TODO Auto-generated method stub
1172 public void updateCharacterStream(int columnIndex, Reader x)
1173 throws SQLException {
1174 // TODO Auto-generated method stub
1179 public void updateAsciiStream(String columnLabel, InputStream x)
1180 throws SQLException {
1181 // TODO Auto-generated method stub
1186 public void updateBinaryStream(String columnLabel, InputStream x)
1187 throws SQLException {
1188 // TODO Auto-generated method stub
1193 public void updateCharacterStream(String columnLabel, Reader reader)
1194 throws SQLException {
1195 // TODO Auto-generated method stub
1200 public void updateBlob(int columnIndex, InputStream inputStream)
1201 throws SQLException {
1202 // TODO Auto-generated method stub
1207 public void updateBlob(String columnLabel, InputStream inputStream)
1208 throws SQLException {
1209 // TODO Auto-generated method stub
1214 public void updateClob(int columnIndex, Reader reader) throws SQLException {
1215 // TODO Auto-generated method stub
1220 public void updateClob(String columnLabel, Reader reader)
1221 throws SQLException {
1222 // TODO Auto-generated method stub
1227 public void updateNClob(int columnIndex, Reader reader)
1228 throws SQLException {
1229 // TODO Auto-generated method stub
1234 public void updateNClob(String columnLabel, Reader reader)
1235 throws SQLException {
1236 // TODO Auto-generated method stub
1241 public <T> T getObject(int columnIndex, Class<T> type) throws SQLException {
1242 // TODO Auto-generated method stub
1247 public <T> T getObject(String columnLabel, Class<T> type)
1248 throws SQLException {
1249 // TODO Auto-generated method stub