Advertisement
Ahmed_Kamal

resultSEt

Dec 6th, 2019
633
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 39.64 KB | None | 0 0
  1. package eg.edu.alexu.csd.oop.jdbc;
  2.  
  3. import java.io.InputStream;
  4. import java.io.Reader;
  5. import java.math.BigDecimal;
  6. import java.net.URL;
  7. import java.sql.*;
  8. import java.util.Calendar;
  9. import java.util.LinkedList;
  10. import java.util.Map;
  11.  
  12. public class myResultSet implements ResultSet {
  13.     private LinkedList<Object[]> selectedTable;
  14.     private String tableName;
  15.     private String[] selectedColumns;
  16.     private Class[] selectedTypes;
  17.     private Object[] currentRow;
  18.     private boolean beforeFirst;
  19.     private boolean afterLast;
  20.     private Statement statement;
  21.     private boolean closed;
  22.     private int cursor;
  23.  
  24.     public myResultSet(Statement statement, Object[][] selectedTable, String[] selectedColumns, Class[] selectedTypes, String tableName) throws SQLException {
  25.         this(statement,selectedTable,selectedColumns,selectedTypes);
  26.         this.tableName = tableName;
  27.     }
  28.  
  29.     // use this constructor when initializing from statement
  30.     public myResultSet(Statement statement, Object[][] selectedTable, String[] selectedColumns, Class[] selectedTypes) throws SQLException {
  31.         this(selectedTable,selectedColumns,selectedTypes);
  32.         this.statement = statement;
  33.     }
  34.  
  35.     public myResultSet(Object[][] selectedTable, String[] selectedColumns, Class[] selectedTypes) throws SQLException {
  36.         // popularize the selectedTable
  37.         this.selectedTable = new LinkedList<>();
  38.         for (int i = 0; i < selectedTable.length; i++) {
  39.             Object[] tempRow = new Object[selectedTable[i].length];
  40.             for (int j = 0; j < selectedTable[i].length; j++) {
  41.                 tempRow[j] = selectedTable[i][j];
  42.             }
  43.             this.selectedTable.add(tempRow);
  44.         }
  45.         this.selectedColumns = selectedColumns;
  46.         this.selectedTypes = selectedTypes;
  47.         this.beforeFirst = true;
  48.         this.afterLast = false;
  49.         this.cursor = -1;
  50.         this.closed = false;
  51.     }
  52.  
  53.     public String getTableName() {
  54.         return this.tableName;
  55.     }
  56.  
  57.     @Override
  58.     public boolean next() throws SQLException {
  59.         if (isClosed()){
  60.             throw new SQLException("already Closed");
  61.         }
  62.         if (!this.afterLast && this.beforeFirst) { // go to first one in the table
  63.             if (this.selectedTable.isEmpty()) { // if table is empty, then it is after last
  64.                 afterLast();
  65.                 return false;
  66.             } else { // if table isn't empty, then it currents row is the first one in table
  67.                 first();
  68.                 return true;
  69.             }
  70.         } else if (this.afterLast && !this.beforeFirst) { // go to beyond the after last, not happeneing
  71.             return false;
  72.         } else if (!this.afterLast) { // go to somewhere in the meddle
  73.             if (isLast()) { // last in the table
  74.                 afterLast();
  75.                 return false;
  76.             } else { // get the next row, if not empty
  77.                 this.cursor = this.selectedTable.indexOf(currentRow) + 1;
  78.                 this.currentRow = this.selectedTable.get(this.cursor);
  79.                 return true;
  80.             }
  81.         }
  82.         return false;
  83.     }
  84.  
  85.     @Override
  86.     public void close() throws SQLException {
  87.         if (this.isClosed()){
  88.             throw new SQLException("already closed");
  89.         }
  90.         this.closed = true;
  91.     }
  92.  
  93.     @Override
  94.     public boolean wasNull() throws SQLException {
  95.         throw new java.lang.UnsupportedOperationException();
  96.  
  97.     }
  98.  
  99.     @Override
  100.     public String getString(int columnIndex) throws SQLException {
  101.         if (currentRow != null) {
  102.             if ((columnIndex >= 1) && (columnIndex <= this.currentRow.length)) { // safe region
  103.                 if (selectedTypes[columnIndex - 1] == String.class) { // still in safe region as, this method returns only the String
  104.                     if (currentRow[columnIndex - 1] == null) { // if the value of some cell is null (sql) then the return value is 0
  105.                         return null;
  106.                     }
  107.                     return (String) currentRow[columnIndex - 1];
  108.                 }
  109.             }
  110.         }
  111.         throw new SQLException("index " + columnIndex + " is not valid");
  112.     }
  113.  
  114.     @Override
  115.     public boolean getBoolean(int columnIndex) throws SQLException {
  116.         throw new java.lang.UnsupportedOperationException();
  117.     }
  118.  
  119.     @Override
  120.     public byte getByte(int columnIndex) throws SQLException {
  121.         throw new java.lang.UnsupportedOperationException();
  122.     }
  123.  
  124.     @Override
  125.     public short getShort(int columnIndex) throws SQLException {
  126.         throw new java.lang.UnsupportedOperationException();
  127.     }
  128.  
  129.     // they are dealing with indexes from 1 to up, not from 0
  130.     @Override
  131.     public int getInt(int columnIndex) throws SQLException {
  132.         if (currentRow != null) {
  133.             if ((columnIndex >= 1) && (columnIndex <= this.currentRow.length)) { // safe region
  134.                 if (selectedTypes[columnIndex - 1] == Integer.class) { // still in safe region as, this method returns only the integer
  135.                     if (currentRow[columnIndex - 1] == null) { // if the value of some cell is null (sql) then the return value is 0
  136.                         return 0;
  137.                     }
  138.                     return (Integer) currentRow[columnIndex - 1];
  139.                 }
  140.             }
  141.         }
  142.         throw new SQLException("index " + columnIndex + " is not valid");
  143.     }
  144.  
  145.     @Override
  146.     public long getLong(int columnIndex) throws SQLException {
  147.         throw new java.lang.UnsupportedOperationException();
  148.     }
  149.  
  150.     @Override
  151.     public float getFloat(int columnIndex) throws SQLException {
  152.         throw new java.lang.UnsupportedOperationException();
  153.     }
  154.  
  155.     @Override
  156.     public double getDouble(int columnIndex) throws SQLException {
  157.         throw new java.lang.UnsupportedOperationException();
  158.     }
  159.  
  160.     @Override
  161.     public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException {
  162.         throw new java.lang.UnsupportedOperationException();
  163.     }
  164.  
  165.     @Override
  166.     public byte[] getBytes(int columnIndex) throws SQLException {
  167.         throw new java.lang.UnsupportedOperationException();
  168.     }
  169.  
  170.     @Override
  171.     public Date getDate(int columnIndex) throws SQLException {
  172.         throw new java.lang.UnsupportedOperationException();
  173.     }
  174.  
  175.     @Override
  176.     public Time getTime(int columnIndex) throws SQLException {
  177.         throw new java.lang.UnsupportedOperationException();
  178.     }
  179.  
  180.     @Override
  181.     public Timestamp getTimestamp(int columnIndex) throws SQLException {
  182.         throw new java.lang.UnsupportedOperationException();
  183.     }
  184.  
  185.     @Override
  186.     public InputStream getAsciiStream(int columnIndex) throws SQLException {
  187.         throw new java.lang.UnsupportedOperationException();
  188.     }
  189.  
  190.     @Override
  191.     public InputStream getUnicodeStream(int columnIndex) throws SQLException {
  192.         throw new java.lang.UnsupportedOperationException();
  193.     }
  194.  
  195.     @Override
  196.     public InputStream getBinaryStream(int columnIndex) throws SQLException {
  197.         throw new java.lang.UnsupportedOperationException();
  198.     }
  199.  
  200.     @Override
  201.     public String getString(String columnLabel) throws SQLException {
  202.         for (int i = 0; i < this.selectedColumns.length; i++) {
  203.             if (this.selectedColumns[i].equals(columnLabel)) {
  204.                 return this.getString(i + 1);
  205.             }
  206.         }
  207.         throw new SQLException("column: " + columnLabel + " not found");
  208.     }
  209.  
  210.     @Override
  211.     public boolean getBoolean(String columnLabel) throws SQLException {
  212.         throw new java.lang.UnsupportedOperationException();
  213.     }
  214.  
  215.     @Override
  216.     public byte getByte(String columnLabel) throws SQLException {
  217.         throw new java.lang.UnsupportedOperationException();
  218.     }
  219.  
  220.     @Override
  221.     public short getShort(String columnLabel) throws SQLException {
  222.         throw new java.lang.UnsupportedOperationException();
  223.     }
  224.  
  225.     @Override
  226.     public int getInt(String columnLabel) throws SQLException {
  227.         for (int i = 0; i < this.selectedColumns.length; i++) {
  228.             if (this.selectedColumns[i].equals(columnLabel)) {
  229.                 return this.getInt(i + 1);
  230.             }
  231.         }
  232.         throw new SQLException("column: " + columnLabel + " not found");
  233.     }
  234.  
  235.     @Override
  236.     public long getLong(String columnLabel) throws SQLException {
  237.         throw new java.lang.UnsupportedOperationException();
  238.     }
  239.  
  240.     @Override
  241.     public float getFloat(String columnLabel) throws SQLException {
  242.         throw new java.lang.UnsupportedOperationException();
  243.     }
  244.  
  245.     @Override
  246.     public double getDouble(String columnLabel) throws SQLException {
  247.         throw new java.lang.UnsupportedOperationException();
  248.     }
  249.  
  250.     @Override
  251.     public BigDecimal getBigDecimal(String columnLabel, int scale) throws SQLException {
  252.         throw new java.lang.UnsupportedOperationException();
  253.     }
  254.  
  255.     @Override
  256.     public byte[] getBytes(String columnLabel) throws SQLException {
  257.         throw new java.lang.UnsupportedOperationException();
  258.     }
  259.  
  260.     @Override
  261.     public Date getDate(String columnLabel) throws SQLException {
  262.         throw new java.lang.UnsupportedOperationException();
  263.     }
  264.  
  265.     @Override
  266.     public Time getTime(String columnLabel) throws SQLException {
  267.         throw new java.lang.UnsupportedOperationException();
  268.     }
  269.  
  270.     @Override
  271.     public Timestamp getTimestamp(String columnLabel) throws SQLException {
  272.         throw new java.lang.UnsupportedOperationException();
  273.     }
  274.  
  275.     @Override
  276.     public InputStream getAsciiStream(String columnLabel) throws SQLException {
  277.         throw new java.lang.UnsupportedOperationException();
  278.     }
  279.  
  280.     @Override
  281.     public InputStream getUnicodeStream(String columnLabel) throws SQLException {
  282.         throw new java.lang.UnsupportedOperationException();
  283.     }
  284.  
  285.     @Override
  286.     public InputStream getBinaryStream(String columnLabel) throws SQLException {
  287.         throw new java.lang.UnsupportedOperationException();
  288.     }
  289.  
  290.     @Override
  291.     public SQLWarning getWarnings() throws SQLException {
  292.         throw new java.lang.UnsupportedOperationException();
  293.     }
  294.  
  295.     @Override
  296.     public void clearWarnings() throws SQLException {
  297.         throw new java.lang.UnsupportedOperationException();
  298.  
  299.     }
  300.  
  301.     @Override
  302.     public String getCursorName() throws SQLException {
  303.         throw new java.lang.UnsupportedOperationException();
  304.     }
  305.  
  306.     @Override
  307.     public ResultSetMetaData getMetaData() throws SQLException {
  308.         return null;
  309.     }
  310.  
  311.     @Override
  312.     public Object getObject(int columnIndex) throws SQLException {
  313.         if (currentRow != null) {
  314.             if ((columnIndex >= 1) && (columnIndex <= this.currentRow.length)) { // safe region
  315.                 if (currentRow[columnIndex - 1] == null) { // if the value of some cell is null (sql) then the return value is 0
  316.                     return null;
  317.                 }
  318.                 return currentRow[columnIndex - 1];
  319.             }
  320.         }
  321.         throw new SQLException("index " + columnIndex + " is not valid");
  322. //        throw new java.lang.UnsupportedOperationException();
  323.     }
  324.  
  325.     @Override
  326.     public Object getObject(String columnLabel) throws SQLException {
  327.         throw new java.lang.UnsupportedOperationException();
  328.     }
  329.  
  330.     // returns the index of the column labeled by columnLabel
  331.     @Override
  332.     public int findColumn(String columnLabel) throws SQLException {
  333.         for (int i = 0; i < this.selectedColumns.length; i++) {
  334.             if (selectedColumns[i].equals(columnLabel)) {
  335.                 return i + 1; // found it
  336.             }
  337.         }
  338.         throw new SQLException("no column found matches: " + columnLabel);
  339.     }
  340.  
  341.     @Override
  342.     public Reader getCharacterStream(int columnIndex) throws SQLException {
  343.         throw new java.lang.UnsupportedOperationException();
  344.     }
  345.  
  346.     @Override
  347.     public Reader getCharacterStream(String columnLabel) throws SQLException {
  348.         throw new java.lang.UnsupportedOperationException();
  349.     }
  350.  
  351.     @Override
  352.     public BigDecimal getBigDecimal(int columnIndex) throws SQLException {
  353.         throw new java.lang.UnsupportedOperationException();
  354.     }
  355.  
  356.     @Override
  357.     public BigDecimal getBigDecimal(String columnLabel) throws SQLException {
  358.         throw new java.lang.UnsupportedOperationException();
  359.     }
  360.  
  361.     @Override
  362.     public boolean isBeforeFirst() throws SQLException {
  363.         if (isClosed()){
  364.             throw new SQLException("already closed");
  365.         }
  366.         return this.beforeFirst && !this.afterLast;
  367.     }
  368.  
  369.     @Override
  370.     public boolean isAfterLast() throws SQLException {
  371.         if (isClosed()){
  372.             throw new SQLException("already closed");
  373.         }
  374.         return this.afterLast && !this.beforeFirst;
  375.     }
  376.  
  377.     @Override
  378.     public boolean isFirst() throws SQLException {
  379.         if (isClosed()){
  380.             throw new SQLException("already Closed");
  381.         }
  382.         return this.cursor == 0;
  383.     }
  384.  
  385.     @Override
  386.     public boolean isLast() throws SQLException {
  387.         if (isClosed()){
  388.             throw new SQLException("already Closed");
  389.         }
  390.         return this.cursor == this.selectedTable.size() - 1;
  391.     }
  392.  
  393.     @Override
  394.     public void beforeFirst() throws SQLException {
  395.         if (isClosed()){
  396.             throw new SQLException("already Closed");
  397.         }
  398.         this.afterLast = false;
  399.         this.beforeFirst = true;
  400.         this.currentRow = null;
  401.         this.cursor = -1;
  402.     }
  403.  
  404.     @Override
  405.     public void afterLast() throws SQLException {
  406.         if (isClosed()){
  407.             throw new SQLException("already Closed");
  408.         }
  409.         this.afterLast = true;
  410.         this.beforeFirst = false;
  411.         this.currentRow = null;
  412.         this.cursor = -1;
  413.     }
  414.  
  415.     // move the courser to the first row in the data
  416.     @Override
  417.     public boolean first() throws SQLException {
  418.         if (this.isClosed()){
  419.             throw new SQLException("already closed");
  420.         }
  421.         if (this.selectedTable.isEmpty()){
  422.             return false;
  423.         }
  424.         // we can do it
  425.         this.beforeFirst = false;
  426.         this.afterLast = false;
  427.         this.currentRow = this.selectedTable.getFirst();
  428.         this.cursor = 0;
  429.         return true;
  430.     }
  431.  
  432.     @Override
  433.     public boolean last() throws SQLException {
  434.         if (this.isClosed()){
  435.             throw new SQLException("already closed");
  436.         }
  437.         if (this.selectedTable.isEmpty()){
  438.             return false;
  439.         }
  440.         this.cursor = this.selectedTable.size() - 1;
  441.         this.currentRow = this.selectedTable.getLast();
  442.         this.beforeFirst = false;
  443.         this.afterLast = false;
  444.         return true;
  445.     }
  446.  
  447.     @Override
  448.     public int getRow() throws SQLException {
  449.         throw new java.lang.UnsupportedOperationException();
  450.     }
  451.  
  452.     @Override
  453.     public boolean absolute(int row) throws SQLException {
  454.         if (isClosed()){
  455.             throw new SQLException("already closed");
  456.         }
  457.         if (row == 0){ // before first
  458.             this.beforeFirst();
  459.             return false;
  460.         } else if (row == this.selectedTable.size() + 1){ // after last
  461.             this.afterLast();
  462.             return false;
  463.         }else if (row == 1){ // first
  464.             this.first();
  465.             return true;
  466.         } else if (row == -1){ // last
  467.             this.last();
  468.             return true;
  469.         } else if (row > 1 && row <= this.selectedTable.size()) { // from the second to the last
  470.             this.cursor = row - 1;
  471.             this.currentRow = this.selectedTable.get(this.cursor);
  472.             return true;
  473.         } else if (row < 0 && (row * -1) <= this.selectedTable.size()){ // negative come from the back, and not exceeding the size
  474.             this.cursor = row + this.selectedTable.size(); // -1 + size() = size() - 1 : last, size() - size() = 0: first
  475.             if (this.cursor == 0){
  476.                 this.first();
  477.             }
  478.             this.currentRow = this.selectedTable.get(this.cursor); // j + size() : j(th) one from the back as j is (-ve)
  479.             return true;
  480.         }
  481.         return false;
  482.     }
  483.  
  484.     @Override
  485.     public boolean relative(int rows) throws SQLException {
  486.         throw new java.lang.UnsupportedOperationException();
  487.     }
  488.  
  489.     @Override
  490.     public boolean previous() throws SQLException {
  491.         if (isClosed()){
  492.             throw new SQLException("already Closed");
  493.         }
  494.         if (this.beforeFirst && !this.afterLast){ // before first position
  495.             return false;  // can't go back one more step
  496.         } else if (!this.beforeFirst && this.afterLast){ // at after last, no more progress, just go back.
  497.             if (this.selectedTable.isEmpty()){ // go to before first
  498.                 beforeFirst();
  499.                 return false;
  500.             } else { // go to the meddle
  501.                 last();
  502.                 return true;
  503.             }
  504.         } else if (!this.beforeFirst){ // in the meddle
  505.             if (isFirst()){ // go to before first
  506.                 beforeFirst();
  507.                 return false;
  508.             } else {
  509.                 this.cursor = this.selectedTable.indexOf(currentRow) - 1;
  510.                 this.currentRow = this.selectedTable.get(this.cursor);
  511.                 return true;
  512.             }
  513.         }
  514.         return false;
  515.     }
  516.  
  517.     @Override
  518.     public void setFetchDirection(int direction) throws SQLException {
  519.         throw new java.lang.UnsupportedOperationException();
  520.     }
  521.  
  522.     @Override
  523.     public int getFetchDirection() throws SQLException {
  524.         throw new java.lang.UnsupportedOperationException();
  525.     }
  526.  
  527.     @Override
  528.     public void setFetchSize(int rows) throws SQLException {
  529.         throw new java.lang.UnsupportedOperationException();
  530.     }
  531.  
  532.     @Override
  533.     public int getFetchSize() throws SQLException {
  534.         throw new java.lang.UnsupportedOperationException();
  535.     }
  536.  
  537.     @Override
  538.     public int getType() throws SQLException {
  539.         throw new java.lang.UnsupportedOperationException();
  540.     }
  541.  
  542.     @Override
  543.     public int getConcurrency() throws SQLException {
  544.         throw new java.lang.UnsupportedOperationException();
  545.     }
  546.  
  547.     @Override
  548.     public boolean rowUpdated() throws SQLException {
  549.         throw new java.lang.UnsupportedOperationException();
  550.     }
  551.  
  552.     @Override
  553.     public boolean rowInserted() throws SQLException {
  554.         throw new java.lang.UnsupportedOperationException();
  555.     }
  556.  
  557.     @Override
  558.     public boolean rowDeleted() throws SQLException {
  559.         throw new java.lang.UnsupportedOperationException();
  560.     }
  561.  
  562.     @Override
  563.     public void updateNull(int columnIndex) throws SQLException {
  564.         throw new java.lang.UnsupportedOperationException();
  565.     }
  566.  
  567.     @Override
  568.     public void updateBoolean(int columnIndex, boolean x) throws SQLException {
  569.         throw new java.lang.UnsupportedOperationException();
  570.     }
  571.  
  572.     @Override
  573.     public void updateByte(int columnIndex, byte x) throws SQLException {
  574.         throw new java.lang.UnsupportedOperationException();
  575.     }
  576.  
  577.     @Override
  578.     public void updateShort(int columnIndex, short x) throws SQLException {
  579.         throw new java.lang.UnsupportedOperationException();
  580.     }
  581.  
  582.     @Override
  583.     public void updateInt(int columnIndex, int x) throws SQLException {
  584.         throw new java.lang.UnsupportedOperationException();
  585.     }
  586.  
  587.     @Override
  588.     public void updateLong(int columnIndex, long x) throws SQLException {
  589.         throw new java.lang.UnsupportedOperationException();
  590.     }
  591.  
  592.     @Override
  593.     public void updateFloat(int columnIndex, float x) throws SQLException {
  594.         throw new java.lang.UnsupportedOperationException();
  595.     }
  596.  
  597.     @Override
  598.     public void updateDouble(int columnIndex, double x) throws SQLException {
  599.         throw new java.lang.UnsupportedOperationException();
  600.     }
  601.  
  602.     @Override
  603.     public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException {
  604.         throw new java.lang.UnsupportedOperationException();
  605.     }
  606.  
  607.     @Override
  608.     public void updateString(int columnIndex, String x) throws SQLException {
  609.         throw new java.lang.UnsupportedOperationException();
  610.     }
  611.  
  612.     @Override
  613.     public void updateBytes(int columnIndex, byte[] x) throws SQLException {
  614.         throw new java.lang.UnsupportedOperationException();
  615.     }
  616.  
  617.     @Override
  618.     public void updateDate(int columnIndex, Date x) throws SQLException {
  619.         throw new java.lang.UnsupportedOperationException();
  620.     }
  621.  
  622.     @Override
  623.     public void updateTime(int columnIndex, Time x) throws SQLException {
  624.         throw new java.lang.UnsupportedOperationException();
  625.     }
  626.  
  627.     @Override
  628.     public void updateTimestamp(int columnIndex, Timestamp x) throws SQLException {
  629.         throw new java.lang.UnsupportedOperationException();
  630.     }
  631.  
  632.     @Override
  633.     public void updateAsciiStream(int columnIndex, InputStream x, int length) throws SQLException {
  634.         throw new java.lang.UnsupportedOperationException();
  635.     }
  636.  
  637.     @Override
  638.     public void updateBinaryStream(int columnIndex, InputStream x, int length) throws SQLException {
  639.         throw new java.lang.UnsupportedOperationException();
  640.     }
  641.  
  642.     @Override
  643.     public void updateCharacterStream(int columnIndex, Reader x, int length) throws SQLException {
  644.         throw new java.lang.UnsupportedOperationException();
  645.     }
  646.  
  647.     @Override
  648.     public void updateObject(int columnIndex, Object x, int scaleOrLength) throws SQLException {
  649.         throw new java.lang.UnsupportedOperationException();
  650.     }
  651.  
  652.     @Override
  653.     public void updateObject(int columnIndex, Object x) throws SQLException {
  654.         throw new java.lang.UnsupportedOperationException();
  655.     }
  656.  
  657.     @Override
  658.     public void updateNull(String columnLabel) throws SQLException {
  659.         throw new java.lang.UnsupportedOperationException();
  660.     }
  661.  
  662.     @Override
  663.     public void updateBoolean(String columnLabel, boolean x) throws SQLException {
  664.         throw new java.lang.UnsupportedOperationException();
  665.     }
  666.  
  667.     @Override
  668.     public void updateByte(String columnLabel, byte x) throws SQLException {
  669.         throw new java.lang.UnsupportedOperationException();
  670.     }
  671.  
  672.     @Override
  673.     public void updateShort(String columnLabel, short x) throws SQLException {
  674.         throw new java.lang.UnsupportedOperationException();
  675.     }
  676.  
  677.     @Override
  678.     public void updateInt(String columnLabel, int x) throws SQLException {
  679.         throw new java.lang.UnsupportedOperationException();
  680.     }
  681.  
  682.     @Override
  683.     public void updateLong(String columnLabel, long x) throws SQLException {
  684.         throw new java.lang.UnsupportedOperationException();
  685.     }
  686.  
  687.     @Override
  688.     public void updateFloat(String columnLabel, float x) throws SQLException {
  689.         throw new java.lang.UnsupportedOperationException();
  690.     }
  691.  
  692.     @Override
  693.     public void updateDouble(String columnLabel, double x) throws SQLException {
  694.         throw new java.lang.UnsupportedOperationException();
  695.     }
  696.  
  697.     @Override
  698.     public void updateBigDecimal(String columnLabel, BigDecimal x) throws SQLException {
  699.         throw new java.lang.UnsupportedOperationException();
  700.     }
  701.  
  702.     @Override
  703.     public void updateString(String columnLabel, String x) throws SQLException {
  704.         throw new java.lang.UnsupportedOperationException();
  705.     }
  706.  
  707.     @Override
  708.     public void updateBytes(String columnLabel, byte[] x) throws SQLException {
  709.         throw new java.lang.UnsupportedOperationException();
  710.     }
  711.  
  712.     @Override
  713.     public void updateDate(String columnLabel, Date x) throws SQLException {
  714.         throw new java.lang.UnsupportedOperationException();
  715.     }
  716.  
  717.     @Override
  718.     public void updateTime(String columnLabel, Time x) throws SQLException {
  719.         throw new java.lang.UnsupportedOperationException();
  720.     }
  721.  
  722.     @Override
  723.     public void updateTimestamp(String columnLabel, Timestamp x) throws SQLException {
  724.         throw new java.lang.UnsupportedOperationException();
  725.     }
  726.  
  727.     @Override
  728.     public void updateAsciiStream(String columnLabel, InputStream x, int length) throws SQLException {
  729.         throw new java.lang.UnsupportedOperationException();
  730.     }
  731.  
  732.     @Override
  733.     public void updateBinaryStream(String columnLabel, InputStream x, int length) throws SQLException {
  734.         throw new java.lang.UnsupportedOperationException();
  735.     }
  736.  
  737.     @Override
  738.     public void updateCharacterStream(String columnLabel, Reader reader, int length) throws SQLException {
  739.         throw new java.lang.UnsupportedOperationException();
  740.     }
  741.  
  742.     @Override
  743.     public void updateObject(String columnLabel, Object x, int scaleOrLength) throws SQLException {
  744.         throw new java.lang.UnsupportedOperationException();
  745.     }
  746.  
  747.     @Override
  748.     public void updateObject(String columnLabel, Object x) throws SQLException {
  749.         throw new java.lang.UnsupportedOperationException();
  750.     }
  751.  
  752.     @Override
  753.     public void insertRow() throws SQLException {
  754.         throw new java.lang.UnsupportedOperationException();
  755.     }
  756.  
  757.     @Override
  758.     public void updateRow() throws SQLException {
  759.         throw new java.lang.UnsupportedOperationException();
  760.     }
  761.  
  762.     @Override
  763.     public void deleteRow() throws SQLException {
  764.         throw new java.lang.UnsupportedOperationException();
  765.     }
  766.  
  767.     @Override
  768.     public void refreshRow() throws SQLException {
  769.         throw new java.lang.UnsupportedOperationException();
  770.     }
  771.  
  772.     @Override
  773.     public void cancelRowUpdates() throws SQLException {
  774.         throw new java.lang.UnsupportedOperationException();
  775.     }
  776.  
  777.     @Override
  778.     public void moveToInsertRow() throws SQLException {
  779.         throw new java.lang.UnsupportedOperationException();
  780.     }
  781.  
  782.     @Override
  783.     public void moveToCurrentRow() throws SQLException {
  784.         throw new java.lang.UnsupportedOperationException();
  785.     }
  786.  
  787.     @Override
  788.     public Statement getStatement() throws SQLException {
  789.         if (isClosed()){
  790.             throw new SQLException("already closed");
  791.         }
  792.         return this.statement;
  793.     }
  794.  
  795.     @Override
  796.     public Object getObject(int columnIndex, Map<String, Class<?>> map) throws SQLException {
  797.         throw new java.lang.UnsupportedOperationException();
  798.     }
  799.  
  800.     @Override
  801.     public Ref getRef(int columnIndex) throws SQLException {
  802.         throw new java.lang.UnsupportedOperationException();
  803.     }
  804.  
  805.     @Override
  806.     public Blob getBlob(int columnIndex) throws SQLException {
  807.         throw new java.lang.UnsupportedOperationException();
  808.     }
  809.  
  810.     @Override
  811.     public Clob getClob(int columnIndex) throws SQLException {
  812.         throw new java.lang.UnsupportedOperationException();
  813.     }
  814.  
  815.     @Override
  816.     public Array getArray(int columnIndex) throws SQLException {
  817.         throw new java.lang.UnsupportedOperationException();
  818.     }
  819.  
  820.     @Override
  821.     public Object getObject(String columnLabel, Map<String, Class<?>> map) throws SQLException {
  822.         throw new java.lang.UnsupportedOperationException();
  823.     }
  824.  
  825.     @Override
  826.     public Ref getRef(String columnLabel) throws SQLException {
  827.         throw new java.lang.UnsupportedOperationException();
  828.     }
  829.  
  830.     @Override
  831.     public Blob getBlob(String columnLabel) throws SQLException {
  832.         throw new java.lang.UnsupportedOperationException();
  833.     }
  834.  
  835.     @Override
  836.     public Clob getClob(String columnLabel) throws SQLException {
  837.         throw new java.lang.UnsupportedOperationException();
  838.     }
  839.  
  840.     @Override
  841.     public Array getArray(String columnLabel) throws SQLException {
  842.         throw new java.lang.UnsupportedOperationException();
  843.     }
  844.  
  845.     @Override
  846.     public Date getDate(int columnIndex, Calendar cal) throws SQLException {
  847.         throw new java.lang.UnsupportedOperationException();
  848.     }
  849.  
  850.     @Override
  851.     public Date getDate(String columnLabel, Calendar cal) throws SQLException {
  852.         throw new java.lang.UnsupportedOperationException();
  853.     }
  854.  
  855.     @Override
  856.     public Time getTime(int columnIndex, Calendar cal) throws SQLException {
  857.         throw new java.lang.UnsupportedOperationException();
  858.     }
  859.  
  860.     @Override
  861.     public Time getTime(String columnLabel, Calendar cal) throws SQLException {
  862.         throw new java.lang.UnsupportedOperationException();
  863.     }
  864.  
  865.     @Override
  866.     public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException {
  867.         throw new java.lang.UnsupportedOperationException();
  868.     }
  869.  
  870.     @Override
  871.     public Timestamp getTimestamp(String columnLabel, Calendar cal) throws SQLException {
  872.         throw new java.lang.UnsupportedOperationException();
  873.     }
  874.  
  875.     @Override
  876.     public URL getURL(int columnIndex) throws SQLException {
  877.         throw new java.lang.UnsupportedOperationException();
  878.     }
  879.  
  880.     @Override
  881.     public URL getURL(String columnLabel) throws SQLException {
  882.         throw new java.lang.UnsupportedOperationException();
  883.     }
  884.  
  885.     @Override
  886.     public void updateRef(int columnIndex, Ref x) throws SQLException {
  887.         throw new java.lang.UnsupportedOperationException();
  888.     }
  889.  
  890.     @Override
  891.     public void updateRef(String columnLabel, Ref x) throws SQLException {
  892.         throw new java.lang.UnsupportedOperationException();
  893.     }
  894.  
  895.     @Override
  896.     public void updateBlob(int columnIndex, Blob x) throws SQLException {
  897.         throw new java.lang.UnsupportedOperationException();
  898.     }
  899.  
  900.     @Override
  901.     public void updateBlob(String columnLabel, Blob x) throws SQLException {
  902.         throw new java.lang.UnsupportedOperationException();
  903.     }
  904.  
  905.     @Override
  906.     public void updateClob(int columnIndex, Clob x) throws SQLException {
  907.         throw new java.lang.UnsupportedOperationException();
  908.     }
  909.  
  910.     @Override
  911.     public void updateClob(String columnLabel, Clob x) throws SQLException {
  912.         throw new java.lang.UnsupportedOperationException();
  913.     }
  914.  
  915.     @Override
  916.     public void updateArray(int columnIndex, Array x) throws SQLException {
  917.         throw new java.lang.UnsupportedOperationException();
  918.     }
  919.  
  920.     @Override
  921.     public void updateArray(String columnLabel, Array x) throws SQLException {
  922.         throw new java.lang.UnsupportedOperationException();
  923.     }
  924.  
  925.     @Override
  926.     public RowId getRowId(int columnIndex) throws SQLException {
  927.         throw new java.lang.UnsupportedOperationException();
  928.     }
  929.  
  930.     @Override
  931.     public RowId getRowId(String columnLabel) throws SQLException {
  932.         throw new java.lang.UnsupportedOperationException();
  933.     }
  934.  
  935.     @Override
  936.     public void updateRowId(int columnIndex, RowId x) throws SQLException {
  937.         throw new java.lang.UnsupportedOperationException();
  938.     }
  939.  
  940.     @Override
  941.     public void updateRowId(String columnLabel, RowId x) throws SQLException {
  942.         throw new java.lang.UnsupportedOperationException();
  943.     }
  944.  
  945.     @Override
  946.     public int getHoldability() throws SQLException {
  947.         throw new java.lang.UnsupportedOperationException();
  948.     }
  949.  
  950.     @Override
  951.     public boolean isClosed() throws SQLException {
  952.         return closed;
  953.     }
  954.  
  955.     @Override
  956.     public void updateNString(int columnIndex, String nString) throws SQLException {
  957.         throw new java.lang.UnsupportedOperationException();
  958.     }
  959.  
  960.     @Override
  961.     public void updateNString(String columnLabel, String nString) throws SQLException {
  962.         throw new java.lang.UnsupportedOperationException();
  963.     }
  964.  
  965.     @Override
  966.     public void updateNClob(int columnIndex, NClob nClob) throws SQLException {
  967.         throw new java.lang.UnsupportedOperationException();
  968.     }
  969.  
  970.     @Override
  971.     public void updateNClob(String columnLabel, NClob nClob) throws SQLException {
  972.         throw new java.lang.UnsupportedOperationException();
  973.     }
  974.  
  975.     @Override
  976.     public NClob getNClob(int columnIndex) throws SQLException {
  977.         throw new java.lang.UnsupportedOperationException();
  978.     }
  979.  
  980.     @Override
  981.     public NClob getNClob(String columnLabel) throws SQLException {
  982.         throw new java.lang.UnsupportedOperationException();
  983.     }
  984.  
  985.     @Override
  986.     public SQLXML getSQLXML(int columnIndex) throws SQLException {
  987.         throw new java.lang.UnsupportedOperationException();
  988.     }
  989.  
  990.     @Override
  991.     public SQLXML getSQLXML(String columnLabel) throws SQLException {
  992.         throw new java.lang.UnsupportedOperationException();
  993.     }
  994.  
  995.     @Override
  996.     public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException {
  997.         throw new java.lang.UnsupportedOperationException();
  998.     }
  999.  
  1000.     @Override
  1001.     public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException {
  1002.         throw new java.lang.UnsupportedOperationException();
  1003.     }
  1004.  
  1005.     @Override
  1006.     public String getNString(int columnIndex) throws SQLException {
  1007.         return null;
  1008.     }
  1009.  
  1010.     @Override
  1011.     public String getNString(String columnLabel) throws SQLException {
  1012.         throw new java.lang.UnsupportedOperationException();
  1013.     }
  1014.  
  1015.     @Override
  1016.     public Reader getNCharacterStream(int columnIndex) throws SQLException {
  1017.         throw new java.lang.UnsupportedOperationException();
  1018.     }
  1019.  
  1020.     @Override
  1021.     public Reader getNCharacterStream(String columnLabel) throws SQLException {
  1022.         throw new java.lang.UnsupportedOperationException();
  1023.     }
  1024.  
  1025.     @Override
  1026.     public void updateNCharacterStream(int columnIndex, Reader x, long length) throws SQLException {
  1027.         throw new java.lang.UnsupportedOperationException();
  1028.     }
  1029.  
  1030.     @Override
  1031.     public void updateNCharacterStream(String columnLabel, Reader reader, long length) throws SQLException {
  1032.         throw new java.lang.UnsupportedOperationException();
  1033.     }
  1034.  
  1035.     @Override
  1036.     public void updateAsciiStream(int columnIndex, InputStream x, long length) throws SQLException {
  1037.         throw new java.lang.UnsupportedOperationException();
  1038.     }
  1039.  
  1040.     @Override
  1041.     public void updateBinaryStream(int columnIndex, InputStream x, long length) throws SQLException {
  1042.         throw new java.lang.UnsupportedOperationException();
  1043.     }
  1044.  
  1045.     @Override
  1046.     public void updateCharacterStream(int columnIndex, Reader x, long length) throws SQLException {
  1047.         throw new java.lang.UnsupportedOperationException();
  1048.     }
  1049.  
  1050.     @Override
  1051.     public void updateAsciiStream(String columnLabel, InputStream x, long length) throws SQLException {
  1052.         throw new java.lang.UnsupportedOperationException();
  1053.     }
  1054.  
  1055.     @Override
  1056.     public void updateBinaryStream(String columnLabel, InputStream x, long length) throws SQLException {
  1057.         throw new java.lang.UnsupportedOperationException();
  1058.     }
  1059.  
  1060.     @Override
  1061.     public void updateCharacterStream(String columnLabel, Reader reader, long length) throws SQLException {
  1062.         throw new java.lang.UnsupportedOperationException();
  1063.     }
  1064.  
  1065.     @Override
  1066.     public void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException {
  1067.         throw new java.lang.UnsupportedOperationException();
  1068.     }
  1069.  
  1070.     @Override
  1071.     public void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException {
  1072.         throw new java.lang.UnsupportedOperationException();
  1073.     }
  1074.  
  1075.     @Override
  1076.     public void updateClob(int columnIndex, Reader reader, long length) throws SQLException {
  1077.         throw new java.lang.UnsupportedOperationException();
  1078.     }
  1079.  
  1080.     @Override
  1081.     public void updateClob(String columnLabel, Reader reader, long length) throws SQLException {
  1082.         throw new java.lang.UnsupportedOperationException();
  1083.     }
  1084.  
  1085.     @Override
  1086.     public void updateNClob(int columnIndex, Reader reader, long length) throws SQLException {
  1087.         throw new java.lang.UnsupportedOperationException();
  1088.     }
  1089.  
  1090.     @Override
  1091.     public void updateNClob(String columnLabel, Reader reader, long length) throws SQLException {
  1092.         throw new java.lang.UnsupportedOperationException();
  1093.     }
  1094.  
  1095.     @Override
  1096.     public void updateNCharacterStream(int columnIndex, Reader x) throws SQLException {
  1097.         throw new java.lang.UnsupportedOperationException();
  1098.     }
  1099.  
  1100.     @Override
  1101.     public void updateNCharacterStream(String columnLabel, Reader reader) throws SQLException {
  1102.         throw new java.lang.UnsupportedOperationException();
  1103.     }
  1104.  
  1105.     @Override
  1106.     public void updateAsciiStream(int columnIndex, InputStream x) throws SQLException {
  1107.         throw new java.lang.UnsupportedOperationException();
  1108.     }
  1109.  
  1110.     @Override
  1111.     public void updateBinaryStream(int columnIndex, InputStream x) throws SQLException {
  1112.         throw new java.lang.UnsupportedOperationException();
  1113.     }
  1114.  
  1115.     @Override
  1116.     public void updateCharacterStream(int columnIndex, Reader x) throws SQLException {
  1117.         throw new java.lang.UnsupportedOperationException();
  1118.     }
  1119.  
  1120.     @Override
  1121.     public void updateAsciiStream(String columnLabel, InputStream x) throws SQLException {
  1122.         throw new java.lang.UnsupportedOperationException();
  1123.     }
  1124.  
  1125.     @Override
  1126.     public void updateBinaryStream(String columnLabel, InputStream x) throws SQLException {
  1127.         throw new java.lang.UnsupportedOperationException();
  1128.     }
  1129.  
  1130.     @Override
  1131.     public void updateCharacterStream(String columnLabel, Reader reader) throws SQLException {
  1132.         throw new java.lang.UnsupportedOperationException();
  1133.     }
  1134.  
  1135.     @Override
  1136.     public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException {
  1137.         throw new java.lang.UnsupportedOperationException();
  1138.     }
  1139.  
  1140.     @Override
  1141.     public void updateBlob(String columnLabel, InputStream inputStream) throws SQLException {
  1142.         throw new java.lang.UnsupportedOperationException();
  1143.     }
  1144.  
  1145.     @Override
  1146.     public void updateClob(int columnIndex, Reader reader) throws SQLException {
  1147.         throw new java.lang.UnsupportedOperationException();
  1148.     }
  1149.  
  1150.     @Override
  1151.     public void updateClob(String columnLabel, Reader reader) throws SQLException {
  1152.         throw new java.lang.UnsupportedOperationException();
  1153.     }
  1154.  
  1155.     @Override
  1156.     public void updateNClob(int columnIndex, Reader reader) throws SQLException {
  1157.         throw new java.lang.UnsupportedOperationException();
  1158.     }
  1159.  
  1160.     @Override
  1161.     public void updateNClob(String columnLabel, Reader reader) throws SQLException {
  1162.         throw new java.lang.UnsupportedOperationException();
  1163.     }
  1164.  
  1165.     @Override
  1166.     public <T> T getObject(int columnIndex, Class<T> type) throws SQLException {
  1167.         throw new java.lang.UnsupportedOperationException();
  1168.     }
  1169.  
  1170.     @Override
  1171.     public <T> T getObject(String columnLabel, Class<T> type) throws SQLException {
  1172.         throw new java.lang.UnsupportedOperationException();
  1173.     }
  1174.  
  1175.     @Override
  1176.     public void updateObject(int columnIndex, Object x, SQLType targetSqlType, int scaleOrLength) throws SQLException {
  1177.         throw new java.lang.UnsupportedOperationException();
  1178.     }
  1179.  
  1180.     @Override
  1181.     public void updateObject(String columnLabel, Object x, SQLType targetSqlType, int scaleOrLength) throws SQLException {
  1182.         throw new java.lang.UnsupportedOperationException();
  1183.     }
  1184.  
  1185.     @Override
  1186.     public void updateObject(int columnIndex, Object x, SQLType targetSqlType) throws SQLException {
  1187.         throw new java.lang.UnsupportedOperationException();
  1188.     }
  1189.  
  1190.     @Override
  1191.     public void updateObject(String columnLabel, Object x, SQLType targetSqlType) throws SQLException {
  1192.         throw new java.lang.UnsupportedOperationException();
  1193.     }
  1194.  
  1195.     @Override
  1196.     public <T> T unwrap(Class<T> iface) throws SQLException {
  1197.         throw new java.lang.UnsupportedOperationException();
  1198.     }
  1199.  
  1200.     @Override
  1201.     public boolean isWrapperFor(Class<?> iface) throws SQLException {
  1202.         throw new java.lang.UnsupportedOperationException();
  1203.     }
  1204.  
  1205. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement