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)
34 public class TablesResultSet implements ResultSet {
36 private String tables[] = null;
39 public TablesResultSet(XSQLBluePrint cache) {
40 //tables = cache.getInterfaceNames();
44 public <T> T unwrap(Class<T> iface) throws SQLException {
45 // TODO Auto-generated method stub
50 public boolean isWrapperFor(Class<?> iface) throws SQLException {
51 // TODO Auto-generated method stub
56 public boolean next() throws SQLException {
61 if (pos >= tables.length) {
68 public void close() throws SQLException {
69 // TODO Auto-generated method stub
74 public boolean wasNull() throws SQLException {
75 // TODO Auto-generated method stub
80 public String getString(int columnIndex) throws SQLException {
85 public boolean getBoolean(int columnIndex) throws SQLException {
86 // TODO Auto-generated method stub
91 public byte getByte(int columnIndex) throws SQLException {
92 // TODO Auto-generated method stub
97 public short getShort(int columnIndex) throws SQLException {
98 // TODO Auto-generated method stub
103 public int getInt(int columnIndex) throws SQLException {
104 // TODO Auto-generated method stub
109 public long getLong(int columnIndex) throws SQLException {
110 // TODO Auto-generated method stub
115 public float getFloat(int columnIndex) throws SQLException {
116 // TODO Auto-generated method stub
121 public double getDouble(int columnIndex) throws SQLException {
122 // TODO Auto-generated method stub
127 public BigDecimal getBigDecimal(int columnIndex, int scale)
128 throws SQLException {
129 // TODO Auto-generated method stub
134 public byte[] getBytes(int columnIndex) throws SQLException {
135 // TODO Auto-generated method stub
140 public Date getDate(int columnIndex) throws SQLException {
141 // TODO Auto-generated method stub
146 public Time getTime(int columnIndex) throws SQLException {
147 // TODO Auto-generated method stub
152 public Timestamp getTimestamp(int columnIndex) throws SQLException {
153 // TODO Auto-generated method stub
158 public InputStream getAsciiStream(int columnIndex) throws SQLException {
159 // TODO Auto-generated method stub
164 public InputStream getUnicodeStream(int columnIndex) throws SQLException {
165 // TODO Auto-generated method stub
170 public InputStream getBinaryStream(int columnIndex) throws SQLException {
171 // TODO Auto-generated method stub
176 public String getString(String columnLabel) throws SQLException {
181 public boolean getBoolean(String columnLabel) throws SQLException {
182 // TODO Auto-generated method stub
187 public byte getByte(String columnLabel) throws SQLException {
188 // TODO Auto-generated method stub
193 public short getShort(String columnLabel) throws SQLException {
194 // TODO Auto-generated method stub
199 public int getInt(String columnLabel) throws SQLException {
200 // TODO Auto-generated method stub
205 public long getLong(String columnLabel) throws SQLException {
206 // TODO Auto-generated method stub
211 public float getFloat(String columnLabel) throws SQLException {
212 // TODO Auto-generated method stub
217 public double getDouble(String columnLabel) throws SQLException {
218 // TODO Auto-generated method stub
223 public BigDecimal getBigDecimal(String columnLabel, int scale)
224 throws SQLException {
225 // TODO Auto-generated method stub
230 public byte[] getBytes(String columnLabel) throws SQLException {
231 // TODO Auto-generated method stub
236 public Date getDate(String columnLabel) throws SQLException {
237 // TODO Auto-generated method stub
242 public Time getTime(String columnLabel) throws SQLException {
243 // TODO Auto-generated method stub
248 public Timestamp getTimestamp(String columnLabel) throws SQLException {
249 // TODO Auto-generated method stub
254 public InputStream getAsciiStream(String columnLabel) throws SQLException {
255 // TODO Auto-generated method stub
260 public InputStream getUnicodeStream(String columnLabel)
261 throws SQLException {
262 // TODO Auto-generated method stub
267 public InputStream getBinaryStream(String columnLabel) throws SQLException {
268 // TODO Auto-generated method stub
273 public SQLWarning getWarnings() throws SQLException {
274 // TODO Auto-generated method stub
279 public void clearWarnings() throws SQLException {
280 // TODO Auto-generated method stub
285 public String getCursorName() throws SQLException {
286 // TODO Auto-generated method stub
291 public ResultSetMetaData getMetaData() throws SQLException {
292 // TODO Auto-generated method stub
297 public Object getObject(int columnIndex) throws SQLException {
298 // TODO Auto-generated method stub
303 public Object getObject(String columnLabel) throws SQLException {
304 // TODO Auto-generated method stub
309 public int findColumn(String columnLabel) throws SQLException {
310 // TODO Auto-generated method stub
315 public Reader getCharacterStream(int columnIndex) throws SQLException {
316 // TODO Auto-generated method stub
321 public Reader getCharacterStream(String columnLabel) throws SQLException {
322 // TODO Auto-generated method stub
327 public BigDecimal getBigDecimal(int columnIndex) throws SQLException {
328 // TODO Auto-generated method stub
333 public BigDecimal getBigDecimal(String columnLabel) throws SQLException {
334 // TODO Auto-generated method stub
339 public boolean isBeforeFirst() throws SQLException {
340 // TODO Auto-generated method stub
345 public boolean isAfterLast() throws SQLException {
346 // TODO Auto-generated method stub
351 public boolean isFirst() throws SQLException {
352 // TODO Auto-generated method stub
357 public boolean isLast() throws SQLException {
358 // TODO Auto-generated method stub
363 public void beforeFirst() throws SQLException {
364 // TODO Auto-generated method stub
369 public void afterLast() throws SQLException {
370 // TODO Auto-generated method stub
375 public boolean first() throws SQLException {
376 // TODO Auto-generated method stub
381 public boolean last() throws SQLException {
382 // TODO Auto-generated method stub
387 public int getRow() throws SQLException {
388 // TODO Auto-generated method stub
393 public boolean absolute(int row) throws SQLException {
394 // TODO Auto-generated method stub
399 public boolean relative(int rows) throws SQLException {
400 // TODO Auto-generated method stub
405 public boolean previous() throws SQLException {
406 // TODO Auto-generated method stub
411 public void setFetchDirection(int direction) throws SQLException {
412 // TODO Auto-generated method stub
417 public int getFetchDirection() throws SQLException {
418 // TODO Auto-generated method stub
423 public void setFetchSize(int rows) throws SQLException {
424 // TODO Auto-generated method stub
429 public int getFetchSize() throws SQLException {
430 // TODO Auto-generated method stub
435 public int getType() throws SQLException {
436 // TODO Auto-generated method stub
441 public int getConcurrency() throws SQLException {
442 // TODO Auto-generated method stub
447 public boolean rowUpdated() throws SQLException {
448 // TODO Auto-generated method stub
453 public boolean rowInserted() throws SQLException {
454 // TODO Auto-generated method stub
459 public boolean rowDeleted() throws SQLException {
460 // TODO Auto-generated method stub
465 public void updateNull(int columnIndex) throws SQLException {
466 // TODO Auto-generated method stub
471 public void updateBoolean(int columnIndex, boolean x) throws SQLException {
472 // TODO Auto-generated method stub
477 public void updateByte(int columnIndex, byte x) throws SQLException {
478 // TODO Auto-generated method stub
483 public void updateShort(int columnIndex, short x) throws SQLException {
484 // TODO Auto-generated method stub
489 public void updateInt(int columnIndex, int x) throws SQLException {
490 // TODO Auto-generated method stub
495 public void updateLong(int columnIndex, long x) throws SQLException {
496 // TODO Auto-generated method stub
501 public void updateFloat(int columnIndex, float x) throws SQLException {
502 // TODO Auto-generated method stub
507 public void updateDouble(int columnIndex, double x) throws SQLException {
508 // TODO Auto-generated method stub
513 public void updateBigDecimal(int columnIndex, BigDecimal x)
514 throws SQLException {
515 // TODO Auto-generated method stub
520 public void updateString(int columnIndex, String x) throws SQLException {
521 // TODO Auto-generated method stub
526 public void updateBytes(int columnIndex, byte[] x) throws SQLException {
527 // TODO Auto-generated method stub
532 public void updateDate(int columnIndex, Date x) throws SQLException {
533 // TODO Auto-generated method stub
538 public void updateTime(int columnIndex, Time x) throws SQLException {
539 // TODO Auto-generated method stub
544 public void updateTimestamp(int columnIndex, Timestamp x)
545 throws SQLException {
546 // TODO Auto-generated method stub
551 public void updateAsciiStream(int columnIndex, InputStream x, int length)
552 throws SQLException {
553 // TODO Auto-generated method stub
558 public void updateBinaryStream(int columnIndex, InputStream x, int length)
559 throws SQLException {
560 // TODO Auto-generated method stub
565 public void updateCharacterStream(int columnIndex, Reader x, int length)
566 throws SQLException {
567 // TODO Auto-generated method stub
572 public void updateObject(int columnIndex, Object x, int scaleOrLength)
573 throws SQLException {
574 // TODO Auto-generated method stub
579 public void updateObject(int columnIndex, Object x) throws SQLException {
580 // TODO Auto-generated method stub
585 public void updateNull(String columnLabel) throws SQLException {
586 // TODO Auto-generated method stub
591 public void updateBoolean(String columnLabel, boolean x)
592 throws SQLException {
593 // TODO Auto-generated method stub
598 public void updateByte(String columnLabel, byte x) throws SQLException {
599 // TODO Auto-generated method stub
604 public void updateShort(String columnLabel, short x) throws SQLException {
605 // TODO Auto-generated method stub
610 public void updateInt(String columnLabel, int x) throws SQLException {
611 // TODO Auto-generated method stub
616 public void updateLong(String columnLabel, long x) throws SQLException {
617 // TODO Auto-generated method stub
622 public void updateFloat(String columnLabel, float x) throws SQLException {
623 // TODO Auto-generated method stub
628 public void updateDouble(String columnLabel, double x) throws SQLException {
629 // TODO Auto-generated method stub
634 public void updateBigDecimal(String columnLabel, BigDecimal x)
635 throws SQLException {
636 // TODO Auto-generated method stub
641 public void updateString(String columnLabel, String x) throws SQLException {
642 // TODO Auto-generated method stub
647 public void updateBytes(String columnLabel, byte[] x) throws SQLException {
648 // TODO Auto-generated method stub
653 public void updateDate(String columnLabel, Date x) throws SQLException {
654 // TODO Auto-generated method stub
659 public void updateTime(String columnLabel, Time x) throws SQLException {
660 // TODO Auto-generated method stub
665 public void updateTimestamp(String columnLabel, Timestamp x)
666 throws SQLException {
667 // TODO Auto-generated method stub
672 public void updateAsciiStream(String columnLabel, InputStream x, int length)
673 throws SQLException {
674 // TODO Auto-generated method stub
679 public void updateBinaryStream(String columnLabel, InputStream x,
681 throws SQLException {
682 // TODO Auto-generated method stub
687 public void updateCharacterStream(String columnLabel, Reader reader,
688 int length) throws SQLException {
689 // TODO Auto-generated method stub
694 public void updateObject(String columnLabel, Object x, int scaleOrLength)
695 throws SQLException {
696 // TODO Auto-generated method stub
701 public void updateObject(String columnLabel, Object x) throws SQLException {
702 // TODO Auto-generated method stub
707 public void insertRow() throws SQLException {
708 // TODO Auto-generated method stub
713 public void updateRow() throws SQLException {
714 // TODO Auto-generated method stub
719 public void deleteRow() throws SQLException {
720 // TODO Auto-generated method stub
725 public void refreshRow() throws SQLException {
726 // TODO Auto-generated method stub
731 public void cancelRowUpdates() throws SQLException {
732 // TODO Auto-generated method stub
737 public void moveToInsertRow() throws SQLException {
738 // TODO Auto-generated method stub
743 public void moveToCurrentRow() throws SQLException {
744 // TODO Auto-generated method stub
749 public Statement getStatement() throws SQLException {
750 // TODO Auto-generated method stub
755 public Object getObject(int columnIndex, Map<String, Class<?>> map)
756 throws SQLException {
757 // TODO Auto-generated method stub
762 public Ref getRef(int columnIndex) throws SQLException {
763 // TODO Auto-generated method stub
768 public Blob getBlob(int columnIndex) throws SQLException {
769 // TODO Auto-generated method stub
774 public Clob getClob(int columnIndex) throws SQLException {
775 // TODO Auto-generated method stub
780 public Array getArray(int columnIndex) throws SQLException {
781 // TODO Auto-generated method stub
786 public Object getObject(String columnLabel, Map<String, Class<?>> map)
787 throws SQLException {
788 // TODO Auto-generated method stub
793 public Ref getRef(String columnLabel) throws SQLException {
794 // TODO Auto-generated method stub
799 public Blob getBlob(String columnLabel) throws SQLException {
800 // TODO Auto-generated method stub
805 public Clob getClob(String columnLabel) throws SQLException {
806 // TODO Auto-generated method stub
811 public Array getArray(String columnLabel) throws SQLException {
812 // TODO Auto-generated method stub
817 public Date getDate(int columnIndex, Calendar cal) throws SQLException {
818 // TODO Auto-generated method stub
823 public Date getDate(String columnLabel, Calendar cal) throws SQLException {
824 // TODO Auto-generated method stub
829 public Time getTime(int columnIndex, Calendar cal) throws SQLException {
830 // TODO Auto-generated method stub
835 public Time getTime(String columnLabel, Calendar cal) throws SQLException {
836 // TODO Auto-generated method stub
841 public Timestamp getTimestamp(int columnIndex, Calendar cal)
842 throws SQLException {
843 // TODO Auto-generated method stub
848 public Timestamp getTimestamp(String columnLabel, Calendar cal)
849 throws SQLException {
850 // TODO Auto-generated method stub
855 public URL getURL(int columnIndex) throws SQLException {
856 // TODO Auto-generated method stub
861 public URL getURL(String columnLabel) throws SQLException {
862 // TODO Auto-generated method stub
867 public void updateRef(int columnIndex, Ref x) throws SQLException {
868 // TODO Auto-generated method stub
873 public void updateRef(String columnLabel, Ref x) throws SQLException {
874 // TODO Auto-generated method stub
879 public void updateBlob(int columnIndex, Blob x) throws SQLException {
880 // TODO Auto-generated method stub
885 public void updateBlob(String columnLabel, Blob x) throws SQLException {
886 // TODO Auto-generated method stub
891 public void updateClob(int columnIndex, Clob x) throws SQLException {
892 // TODO Auto-generated method stub
897 public void updateClob(String columnLabel, Clob x) throws SQLException {
898 // TODO Auto-generated method stub
903 public void updateArray(int columnIndex, Array x) throws SQLException {
904 // TODO Auto-generated method stub
909 public void updateArray(String columnLabel, Array x) throws SQLException {
910 // TODO Auto-generated method stub
915 public RowId getRowId(int columnIndex) throws SQLException {
916 // TODO Auto-generated method stub
921 public RowId getRowId(String columnLabel) throws SQLException {
922 // TODO Auto-generated method stub
927 public void updateRowId(int columnIndex, RowId x) throws SQLException {
928 // TODO Auto-generated method stub
933 public void updateRowId(String columnLabel, RowId x) throws SQLException {
934 // TODO Auto-generated method stub
939 public int getHoldability() throws SQLException {
940 // TODO Auto-generated method stub
945 public boolean isClosed() throws SQLException {
946 // TODO Auto-generated method stub
951 public void updateNString(int columnIndex, String nString)
952 throws SQLException {
953 // TODO Auto-generated method stub
958 public void updateNString(String columnLabel, String nString)
959 throws SQLException {
960 // TODO Auto-generated method stub
965 public void updateNClob(int columnIndex, NClob nClob) throws SQLException {
966 // TODO Auto-generated method stub
971 public void updateNClob(String columnLabel, NClob nClob)
972 throws SQLException {
973 // TODO Auto-generated method stub
978 public NClob getNClob(int columnIndex) throws SQLException {
979 // TODO Auto-generated method stub
984 public NClob getNClob(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 void updateSQLXML(int columnIndex, SQLXML xmlObject)
1003 throws SQLException {
1004 // TODO Auto-generated method stub
1009 public void updateSQLXML(String columnLabel, SQLXML xmlObject)
1010 throws SQLException {
1011 // TODO Auto-generated method stub
1016 public String getNString(int columnIndex) throws SQLException {
1017 // TODO Auto-generated method stub
1022 public String getNString(String columnLabel) throws SQLException {
1023 // TODO Auto-generated method stub
1028 public Reader getNCharacterStream(int columnIndex) throws SQLException {
1029 // TODO Auto-generated method stub
1034 public Reader getNCharacterStream(String columnLabel) throws SQLException {
1035 // TODO Auto-generated method stub
1040 public void updateNCharacterStream(int columnIndex, Reader x, long length)
1041 throws SQLException {
1042 // TODO Auto-generated method stub
1047 public void updateNCharacterStream(String columnLabel, Reader reader,
1048 long length) throws SQLException {
1049 // TODO Auto-generated method stub
1054 public void updateAsciiStream(int columnIndex, InputStream x, long length)
1055 throws SQLException {
1056 // TODO Auto-generated method stub
1061 public void updateBinaryStream(int columnIndex, InputStream x, long length)
1062 throws SQLException {
1063 // TODO Auto-generated method stub
1068 public void updateCharacterStream(int columnIndex, Reader x, long length)
1069 throws SQLException {
1070 // TODO Auto-generated method stub
1075 public void updateAsciiStream(String columnLabel, InputStream x,
1077 throws SQLException {
1078 // TODO Auto-generated method stub
1083 public void updateBinaryStream(String columnLabel, InputStream x,
1084 long length) throws SQLException {
1085 // TODO Auto-generated method stub
1090 public void updateCharacterStream(String columnLabel, Reader reader,
1091 long length) throws SQLException {
1092 // TODO Auto-generated method stub
1097 public void updateBlob(int columnIndex, InputStream inputStream,
1099 throws SQLException {
1100 // TODO Auto-generated method stub
1105 public void updateBlob(String columnLabel, InputStream inputStream,
1106 long length) throws SQLException {
1107 // TODO Auto-generated method stub
1112 public void updateClob(int columnIndex, Reader reader, long length)
1113 throws SQLException {
1114 // TODO Auto-generated method stub
1119 public void updateClob(String columnLabel, Reader reader, long length)
1120 throws SQLException {
1121 // TODO Auto-generated method stub
1126 public void updateNClob(int columnIndex, Reader reader, long length)
1127 throws SQLException {
1128 // TODO Auto-generated method stub
1133 public void updateNClob(String columnLabel, Reader reader, long length)
1134 throws SQLException {
1135 // TODO Auto-generated method stub
1140 public void updateNCharacterStream(int columnIndex, Reader x)
1141 throws SQLException {
1142 // TODO Auto-generated method stub
1147 public void updateNCharacterStream(String columnLabel, Reader reader)
1148 throws SQLException {
1149 // TODO Auto-generated method stub
1154 public void updateAsciiStream(int columnIndex, InputStream x)
1155 throws SQLException {
1156 // TODO Auto-generated method stub
1161 public void updateBinaryStream(int columnIndex, InputStream x)
1162 throws SQLException {
1163 // TODO Auto-generated method stub
1168 public void updateCharacterStream(int columnIndex, Reader x)
1169 throws SQLException {
1170 // TODO Auto-generated method stub
1175 public void updateAsciiStream(String columnLabel, InputStream x)
1176 throws SQLException {
1177 // TODO Auto-generated method stub
1182 public void updateBinaryStream(String columnLabel, InputStream x)
1183 throws SQLException {
1184 // TODO Auto-generated method stub
1189 public void updateCharacterStream(String columnLabel, Reader reader)
1190 throws SQLException {
1191 // TODO Auto-generated method stub
1196 public void updateBlob(int columnIndex, InputStream inputStream)
1197 throws SQLException {
1198 // TODO Auto-generated method stub
1203 public void updateBlob(String columnLabel, InputStream inputStream)
1204 throws SQLException {
1205 // TODO Auto-generated method stub
1210 public void updateClob(int columnIndex, Reader reader) throws SQLException {
1211 // TODO Auto-generated method stub
1216 public void updateClob(String columnLabel, Reader reader)
1217 throws SQLException {
1218 // TODO Auto-generated method stub
1223 public void updateNClob(int columnIndex, Reader reader)
1224 throws SQLException {
1225 // TODO Auto-generated method stub
1230 public void updateNClob(String columnLabel, Reader reader)
1231 throws SQLException {
1232 // TODO Auto-generated method stub
1237 public <T> T getObject(int columnIndex, Class<T> type) throws SQLException {
1238 // TODO Auto-generated method stub
1243 public <T> T getObject(String columnLabel, Class<T> type)
1244 throws SQLException {
1245 // TODO Auto-generated method stub