UnmodifiableResultSet.java :  » Database-DBMS » axion » org » axiondb » jdbc » Java Open Source

Java Open Source » Database DBMS » axion 
axion » org » axiondb » jdbc » UnmodifiableResultSet.java
/*
 * $Id: UnmodifiableResultSet.java,v 1.2 2007/11/13 19:04:01 rwald Exp $
 * =======================================================================
 * Copyright (c) 2005 Axion Development Team.  All rights reserved.
 *  
 * Redistribution and use in source and binary forms, with or without 
 * modification, are permitted provided that the following conditions 
 * are met:
 * 
 * 1. Redistributions of source code must retain the above 
 *    copyright notice, this list of conditions and the following 
 *    disclaimer. 
 *   
 * 2. Redistributions in binary form must reproduce the above copyright 
 *    notice, this list of conditions and the following disclaimer in 
 *    the documentation and/or other materials provided with the 
 *    distribution. 
 *   
 * 3. The names "Tigris", "Axion", nor the names of its contributors may 
 *    not be used to endorse or promote products derived from this 
 *    software without specific prior written permission. 
 *  
 * 4. Products derived from this software may not be called "Axion", nor 
 *    may "Tigris" or "Axion" appear in their names without specific prior
 *    written permission.
 *   
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 * =======================================================================
 */
package org.axiondb.jdbc;

import java.io.InputStream;
import java.io.Reader;
import java.math.BigDecimal;
import java.sql.Array;
import java.sql.Blob;
import java.sql.Clob;
import java.sql.Date;
import java.sql.NClob;
import java.sql.Ref;
import java.sql.ResultSet;
import java.sql.RowId;
import java.sql.SQLException;
import java.sql.SQLXML;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.Map;

/**
 * @author Jonathan Giron
 * @version $Revision: 1.2 $
 */
public final class UnmodifiableResultSet extends BaseAxionResultSetDecorator {

    public static ResultSet decorate(ResultSet that) {
        return (null == that) ? null : (that instanceof UnmodifiableResultSet) ? that : new UnmodifiableResultSet(that);
    }

    /**
     * @param rs ResultSet that need to be decorated
     */
    public UnmodifiableResultSet(ResultSet rs) {
        super(rs);
    }

    public void cancelRowUpdates() throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void deleteRow() throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void insertRow() throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void moveToCurrentRow() throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void moveToInsertRow() throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateArray(int columnIndex, Array x) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateArray(String columnName, Array x) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateAsciiStream(int columnIndex, InputStream x, int length) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateAsciiStream(String columnName, InputStream x, int length) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateBigDecimal(String columnName, BigDecimal x) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateBinaryStream(int columnIndex, InputStream x, int length) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateBinaryStream(String columnName, InputStream x, int length) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateBlob(int columnIndex, Blob x) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateBlob(String columnName, Blob x) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateBoolean(int columnIndex, boolean x) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateBoolean(String columnName, boolean x) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateByte(int columnIndex, byte x) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateByte(String columnName, byte x) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateBytes(int columnIndex, byte[] x) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateBytes(String columnName, byte[] x) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateCharacterStream(int columnIndex, Reader x, int length) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateCharacterStream(String columnName, Reader reader, int length) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateClob(int columnIndex, Clob x) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateClob(String columnName, Clob x) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateDate(int columnIndex, Date x) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateDate(String columnName, Date x) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateDouble(int columnIndex, double x) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateDouble(String columnName, double x) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateFloat(int columnIndex, float x) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateFloat(String columnName, float x) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateInt(int columnIndex, int x) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateInt(String columnName, int x) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateLong(int columnIndex, long x) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateLong(String columnName, long x) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateNull(int columnIndex) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateNull(String columnName) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateObject(int columnIndex, Object x) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateObject(int columnIndex, Object x, int scale) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateObject(String columnName, Object x) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateObject(String columnName, Object x, int scale) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateRef(int columnIndex, Ref x) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateRef(String columnName, Ref x) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateRow() throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateShort(int columnIndex, short x) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateShort(String columnName, short x) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateString(int columnIndex, String x) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateString(String columnName, String x) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateTime(int columnIndex, Time x) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateTime(String columnName, Time x) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateTimestamp(int columnIndex, Timestamp x) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

    public void updateTimestamp(String columnName, Timestamp x) throws SQLException {
        throw new SQLException("Read-only ResultSet - not supported.");
    }

  @Override
  public int getHoldability() throws SQLException {
    throw new SQLException("Not implemented");
  }

  @Override
  public Reader getNCharacterStream(int arg0) throws SQLException {
    throw new SQLException("Not implemented");
  }

  @Override
  public Reader getNCharacterStream(String arg0) throws SQLException {
    throw new SQLException("Not implemented");
  }

  @Override
  public NClob getNClob(int arg0) throws SQLException {
    throw new SQLException("Not implemented");
  }

  @Override
  public NClob getNClob(String arg0) throws SQLException {
    throw new SQLException("Not implemented");
  }

  @Override
  public String getNString(int arg0) throws SQLException {
    throw new SQLException("Not implemented");
  }

  @Override
  public String getNString(String arg0) throws SQLException {
    throw new SQLException("Not implemented");
  }

  @Override
  public Object getObject(int arg0, Map arg1)
      throws SQLException {
    throw new SQLException("Not implemented");
  }

  @Override
  public Object getObject(String arg0, Map arg1)
      throws SQLException {
    throw new SQLException("Not implemented");
  }

  @Override
  public RowId getRowId(int arg0) throws SQLException {
    throw new SQLException("Not implemented");
  }

  @Override
  public RowId getRowId(String arg0) throws SQLException {
    throw new SQLException("Not implemented");
  }

  @Override
  public SQLXML getSQLXML(int arg0) throws SQLException {
    throw new SQLException("Not implemented");
  }

  @Override
  public SQLXML getSQLXML(String arg0) throws SQLException {
    throw new SQLException("Not implemented");
  }

  @Override
  public boolean isClosed() throws SQLException {
    throw new SQLException("Not implemented");
  }

  @Override
  public void updateAsciiStream(int arg0, InputStream arg1)
      throws SQLException {
    throw new SQLException("Not implemented");
    
  }

  @Override
  public void updateAsciiStream(String arg0, InputStream arg1)
      throws SQLException {
    throw new SQLException("Not implemented");
    
  }

  @Override
  public void updateAsciiStream(int arg0, InputStream arg1, long arg2)
      throws SQLException {
    throw new SQLException("Not implemented");
    
  }

  @Override
  public void updateAsciiStream(String arg0, InputStream arg1, long arg2)
      throws SQLException {
    throw new SQLException("Not implemented");
    
  }

  @Override
  public void updateBinaryStream(int arg0, InputStream arg1)
      throws SQLException {
    throw new SQLException("Not implemented");
    
  }

  @Override
  public void updateBinaryStream(String arg0, InputStream arg1)
      throws SQLException {
    throw new SQLException("Not supported");
  }

  @Override
  public void updateBinaryStream(int arg0, InputStream arg1, long arg2)
      throws SQLException {
    throw new SQLException("Not supported");
  }

  @Override
  public void updateBinaryStream(String arg0, InputStream arg1, long arg2)
      throws SQLException {
    throw new SQLException("Not supported");
  }

  @Override
  public void updateBlob(int arg0, InputStream arg1) throws SQLException {
    throw new SQLException("Not supported");
  }

  @Override
  public void updateBlob(String arg0, InputStream arg1) throws SQLException {
    throw new SQLException("Not supported");
  }

  @Override
  public void updateBlob(int arg0, InputStream arg1, long arg2)
      throws SQLException {
    throw new SQLException("Not supported");
  }

  @Override
  public void updateBlob(String arg0, InputStream arg1, long arg2)
      throws SQLException {
    throw new SQLException("Not supported");
  }

  @Override
  public void updateCharacterStream(int arg0, Reader arg1)
      throws SQLException {
    throw new SQLException("Not implemented");
    
  }

  @Override
  public void updateCharacterStream(String arg0, Reader arg1)
      throws SQLException {
    throw new SQLException("Not implemented");
    
  }

  @Override
  public void updateCharacterStream(int arg0, Reader arg1, long arg2)
      throws SQLException {
    throw new SQLException("Not implemented");
    
  }

  @Override
  public void updateCharacterStream(String arg0, Reader arg1, long arg2)
      throws SQLException {
    throw new SQLException("Not implemented");
    
  }

  @Override
  public void updateClob(int arg0, Reader arg1) throws SQLException {
    throw new SQLException("Not implemented");
    
  }

  @Override
  public void updateClob(String arg0, Reader arg1) throws SQLException {
    throw new SQLException("Not implemented");
    
  }

  @Override
  public void updateClob(int arg0, Reader arg1, long arg2)
      throws SQLException {
    throw new SQLException("Not implemented");
    
  }

  @Override
  public void updateClob(String arg0, Reader arg1, long arg2)
      throws SQLException {
    throw new SQLException("Not implemented");
    
  }

  @Override
  public void updateNCharacterStream(int arg0, Reader arg1)
      throws SQLException {
    throw new SQLException("Not implemented");
    
  }

  @Override
  public void updateNCharacterStream(String arg0, Reader arg1)
      throws SQLException {
    throw new SQLException("Not implemented");
    
  }

  @Override
  public void updateNCharacterStream(int arg0, Reader arg1, long arg2)
      throws SQLException {
    throw new SQLException("Not implemented");
    
  }

  @Override
  public void updateNCharacterStream(String arg0, Reader arg1, long arg2)
      throws SQLException {
    throw new SQLException("Not implemented");
    
  }

  @Override
  public void updateNClob(int arg0, NClob arg1) throws SQLException {
    throw new SQLException("Not implemented");
    
  }

  @Override
  public void updateNClob(String arg0, NClob arg1) throws SQLException {
    throw new SQLException("Not implemented");
    
  }

  @Override
  public void updateNClob(int arg0, Reader arg1) throws SQLException {
    throw new SQLException("Not implemented");
    
  }

  @Override
  public void updateNClob(String arg0, Reader arg1) throws SQLException {
    throw new SQLException("Not implemented");
    
  }

  @Override
  public void updateNClob(int arg0, Reader arg1, long arg2)
      throws SQLException {
    throw new SQLException("Not implemented");
    
  }

  @Override
  public void updateNClob(String arg0, Reader arg1, long arg2)
      throws SQLException {
    throw new SQLException("Not implemented");
    
  }

  @Override
  public void updateNString(int arg0, String arg1) throws SQLException {
    throw new SQLException("Not implemented");
    
  }

  @Override
  public void updateNString(String arg0, String arg1) throws SQLException {
    throw new SQLException("Not implemented");
    
  }

  @Override
  public void updateRowId(int arg0, RowId arg1) throws SQLException {
    throw new SQLException("Not implemented");
    
  }

  @Override
  public void updateRowId(String arg0, RowId arg1) throws SQLException {
    throw new SQLException("Not implemented");
    
  }

  @Override
  public void updateSQLXML(int arg0, SQLXML arg1) throws SQLException {
    throw new SQLException("Not implemented");
    
  }

  @Override
  public void updateSQLXML(String arg0, SQLXML arg1) throws SQLException {
    throw new SQLException("Not implemented");
    
  }

  @Override
  public boolean isWrapperFor(Class<?> arg0) throws SQLException {
    throw new SQLException("Not implemented");
  }

  @Override
  public <T> T unwrap(Class<T> arg0) throws SQLException {
    throw new SQLException("Not implemented");
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.