/*

 * SpacePreparedStatement.java

 *

 * Created on 21 de noviembre de 2003, 11:02

 */



package q02b.exe.arquitectura.utils.tablasBD.helpers;

import java.net.URL;

import java.sql.ParameterMetaData;

import java.sql.ResultSet;

import java.sql.SQLException;



import q02b.exe.arquitectura.utils.Q02bUtils;

/**

 *

 * @author  laura.cantero 

 */

public class Q02bSpacePreparedStatement implements java.sql.PreparedStatement {

    private java.sql.PreparedStatement orig;

    //private java.sql.PreparedStatement orig;

    private int[]tipoDatos;

    private int[]longDatos;

    /** Creates a new instance of SpacePreparedStatement */

    public Q02bSpacePreparedStatement(int []tipos, int []longitudes , java.sql.PreparedStatement orig) {

       

        tipoDatos = tipos;

        longDatos = longitudes;

	    this.orig = orig;

        

        

    }

    

    public void addBatch() throws java.sql.SQLException {

        orig.addBatch();

    }

    

    public void addBatch(String str) throws java.sql.SQLException {

        orig.addBatch(str);

    }

    

    public void cancel() throws java.sql.SQLException {

        orig.cancel();

    }

    

    public void clearBatch() throws java.sql.SQLException {

        orig.clearBatch();

    }

    

    public void clearParameters() throws java.sql.SQLException {

        orig.clearParameters();

    }

    

    public void clearWarnings() throws java.sql.SQLException {

        orig.clearWarnings();

    }

    

    protected Object clone() throws java.lang.CloneNotSupportedException {

        Object retValue;

        

        retValue = clone();

        return retValue;

    }

    

    public void close() throws java.sql.SQLException {

		//ESto antes estaba comentado..... por qué???

        orig.close();

    }

    

    public boolean equals(Object obj) {

        boolean retValue;

        

        retValue = orig.equals(obj);

        return retValue;

    }

    

    public boolean execute() throws java.sql.SQLException {

        boolean retValue;

        

        retValue = orig.execute();

        return retValue;

    }

    

    public boolean execute(String str) throws java.sql.SQLException {

        boolean retValue;

        

        retValue = orig.execute(str);

        return retValue;

    }

    

    public boolean execute(String str, int param) throws java.sql.SQLException {

        boolean retValue;

        

        retValue = orig.execute(str, param);

        return retValue;

    }

    

    public boolean execute(String str, int[] values) throws java.sql.SQLException {

        boolean retValue;

        

        retValue = orig.execute(str, values);

        return retValue;

    }

    

    public boolean execute(String str, String[] str1) throws java.sql.SQLException {

        boolean retValue;

        

        retValue = orig.execute(str, str1);

        return retValue;

    }

    

     public boolean getMoreResults() throws java.sql.SQLException {

        return orig.getMoreResults();

     }

    

    public int[] executeBatch() throws java.sql.SQLException {

        int[] retValue;

        

        retValue = orig.executeBatch();

        return retValue;

    }

    

    public java.sql.ResultSet executeQuery() throws java.sql.SQLException {

        

       Q02bTrimResultSet retValue;

        retValue = new Q02bTrimResultSet( orig.executeQuery() );

        return (java.sql.ResultSet)retValue;

		//return orig.executeQuery();

		

    }

    

   public java.sql.ResultSet executeQuery(String sql) throws java.sql.SQLException {

        

        Q02bTrimResultSet retValue;

        retValue = new Q02bTrimResultSet( orig.executeQuery() );

        return (java.sql.ResultSet)retValue;

	

    }

    

    public int executeUpdate() throws java.sql.SQLException {

        int retValue;

        

        retValue = orig.executeUpdate();

        return retValue;

    }

    

    public int executeUpdate(String str) throws java.sql.SQLException {

        int retValue;

        

        retValue = orig.executeUpdate(str);

        return retValue;

    }

    

    public int executeUpdate(String str, int param) throws java.sql.SQLException {

        int retValue;

        

        retValue = orig.executeUpdate(str, param);

        return retValue;

    }

    

    public int executeUpdate(String str, int[] values) throws java.sql.SQLException {

        int retValue;

        

        retValue = orig.executeUpdate(str, values);

        return retValue;

    }

    

    public int executeUpdate(String str, String[] str1) throws java.sql.SQLException {

        int retValue;

        

        retValue = orig.executeUpdate(str, str1);

        return retValue;

    }

    

    protected void finalize() throws java.lang.Throwable {

        //finalize();

    }

    

    public java.sql.Connection getConnection() throws java.sql.SQLException {

        java.sql.Connection retValue;

        

        retValue = orig.getConnection();

        return retValue;

    }

    

    public int getFetchDirection() throws java.sql.SQLException {

        int retValue;

        

        retValue = orig.getFetchDirection();

        return retValue;

    }

    

    public int getFetchSize() throws java.sql.SQLException {

        int retValue;

        

        retValue = orig.getFetchSize();

        return retValue;

    }

    

  

    

    public int getMaxFieldSize() throws java.sql.SQLException {

        int retValue;

        

        retValue = orig.getMaxFieldSize();

        return retValue;

    }

    

    public int getMaxRows() throws java.sql.SQLException {

        int retValue;

        

        retValue = orig.getMaxRows();

        return retValue;

    }

    

    public java.sql.ResultSetMetaData getMetaData() throws java.sql.SQLException {

        java.sql.ResultSetMetaData retValue;

        

        retValue = orig.getMetaData();

        return retValue;

    }

    

   

    

  

    

    public int getQueryTimeout() throws java.sql.SQLException {

        int retValue;

        

        retValue = orig.getQueryTimeout();

        return retValue;

    }

    

    public java.sql.ResultSet getResultSet() throws java.sql.SQLException {

        java.sql.ResultSet retValue;

        

        retValue = orig.getResultSet();

        return retValue;

    }

    

    public int getResultSetConcurrency() throws java.sql.SQLException {

        int retValue;

        

        retValue = orig.getResultSetConcurrency();

        return retValue;

    }

    

   

    

    public int getResultSetType() throws java.sql.SQLException {

        int retValue;

        

        retValue = orig.getResultSetType();

        return retValue;

    }

    

    public int getUpdateCount() throws java.sql.SQLException {

        int retValue;

        

        retValue = orig.getUpdateCount();

        return retValue;

    }

    

    public java.sql.SQLWarning getWarnings() throws java.sql.SQLException {

        java.sql.SQLWarning retValue;

        

        retValue = orig.getWarnings();

        return retValue;

    }

    

    public int hashCode() {

        int retValue;

        

        retValue = orig.hashCode();

        return retValue;

    }

    

    public void setArray(int param, java.sql.Array array) throws java.sql.SQLException {

        orig.setArray(param, array);

    }

    

    public void setAsciiStream(int param, java.io.InputStream inputStream, int param2) throws java.sql.SQLException {

        orig.setAsciiStream(param, inputStream, param2);

    }

    

    public void setBigDecimal(int param, java.math.BigDecimal bigDecimal) throws java.sql.SQLException {

        orig.setBigDecimal(param, bigDecimal);

    }

    

    public void setBinaryStream(int param, java.io.InputStream inputStream, int param2) throws java.sql.SQLException {

        orig.setBinaryStream(param, inputStream, param2);

    }

    

    public void setBlob(int param, java.sql.Blob blob) throws java.sql.SQLException {

        orig.setBlob(param, blob);

    }

    

    public void setBoolean(int param, boolean param1) throws java.sql.SQLException {

        orig.setBoolean(param, param1);

    }

    

    public void setByte(int param, byte param1) throws java.sql.SQLException {

        orig.setByte(param, param1);

    }

    

    public void setBytes(int param, byte[] values) throws java.sql.SQLException {

        orig.setBytes(param, values);

    }

    

    public void setCharacterStream(int param, java.io.Reader reader, int param2) throws java.sql.SQLException {

        orig.setCharacterStream(param, reader, param2);

    }

    

    public void setClob(int param, java.sql.Clob clob) throws java.sql.SQLException {

        orig.setClob(param, clob);

    }

    

    public void setCursorName(String str) throws java.sql.SQLException {

        orig.setCursorName(str);

    }

    

    public void setDate(int param, java.sql.Date date) throws java.sql.SQLException {

        orig.setDate(param, date);

    }

    

    public void setDate(int param, java.sql.Date date, java.util.Calendar calendar) throws java.sql.SQLException {

        orig.setDate(param, date, calendar);

    }

    

    public void setDouble(int param, double param1) throws java.sql.SQLException {

        orig.setDouble(param, param1);

    }

    

    public void setEscapeProcessing(boolean param) throws java.sql.SQLException {

        orig.setEscapeProcessing(param);

    }

    

    public void setFetchDirection(int param) throws java.sql.SQLException {

        orig.setFetchDirection(param);

    }

    

    public void setFetchSize(int param) throws java.sql.SQLException {

        orig.setFetchSize(param);

    }

    

    public void setFloat(int param, float param1) throws java.sql.SQLException {

        orig.setFloat(param, param1);

    }

    

    public void setInt(int param, int param1) throws java.sql.SQLException {

        orig.setInt(param, param1);

    }

    

    public void setLong(int param, long param1) throws java.sql.SQLException {

        orig.setLong(param, param1);

    }

    

    public void setMaxFieldSize(int param) throws java.sql.SQLException {

        orig.setMaxFieldSize(param);

    }

    

    public void setMaxRows(int param) throws java.sql.SQLException {

        orig.setMaxRows(param);

    }

    

    public void setNull(int param, int param1) throws java.sql.SQLException {

        orig.setNull(param, param1);

    }

    

    public void setNull(int param, int param1, String str) throws java.sql.SQLException {

        orig.setNull(param, param1, str);

    }

    

    public void setObject(int param, Object obj) throws java.sql.SQLException {

        orig.setObject(param, obj);

    }

    

    public void setObject(int param, Object obj, int param2) throws java.sql.SQLException {

        orig.setObject(param, obj, param2);

    }

    

    public void setObject(int param, Object obj, int param2, int param3) throws java.sql.SQLException {

        orig.setObject(param, obj, param2, param3);

    }

    

    public void setQueryTimeout(int param) throws java.sql.SQLException {

        orig.setQueryTimeout(param);

    }

    

    public void setRef(int param, java.sql.Ref ref) throws java.sql.SQLException {

        orig.setRef(param, ref);

    }

    

    public void setShort(int param, short param1) throws java.sql.SQLException {

        orig.setShort(param, param1);

    }

    

    public void setString(int param, String str) throws java.sql.SQLException {

        String strFinal;

        

        strFinal=str;

        if (tipoDatos[param-1]==java.sql.Types.CHAR){

            strFinal = Q02bUtils.addSpaces(str,longDatos[param-1]);

        }

        orig.setString(param, strFinal);

         

    }

    

     public void setString(int param, String str,int pos) throws java.sql.SQLException {

        String strFinal;

        

        strFinal=str;

        if (tipoDatos[pos-1]==java.sql.Types.CHAR){

            strFinal = Q02bUtils.addSpaces(str,longDatos[pos-1]);

        }

        orig.setString(param, strFinal);

         

    }

    

    public void setTime(int param, java.sql.Time time) throws java.sql.SQLException {

        orig.setTime(param, time);

    }

    

    public void setTime(int param, java.sql.Time time, java.util.Calendar calendar) throws java.sql.SQLException {

        orig.setTime(param, time, calendar);

    }

    

    public void setTimestamp(int param, java.sql.Timestamp timestamp) throws java.sql.SQLException {

        orig.setTimestamp(param, timestamp);

    }

    

    public void setTimestamp(int param, java.sql.Timestamp timestamp, java.util.Calendar calendar) throws java.sql.SQLException {

        orig.setTimestamp(param, timestamp, calendar);

    }

    

   

    

    public void setUnicodeStream(int param, java.io.InputStream inputStream, int param2) throws java.sql.SQLException {

        orig.setUnicodeStream(param, inputStream, param2);

    }

    

    public String toString() {

        String retValue;

        

        retValue = orig.toString();

        return retValue;

    }



	public ParameterMetaData getParameterMetaData() throws SQLException {

		// TODO Auto-generated method stub

		return null;

	}



	public void setURL(int arg0, URL arg1) throws SQLException {

		// TODO Auto-generated method stub

		

	}



	public ResultSet getGeneratedKeys() throws SQLException {

		// TODO Auto-generated method stub

		return null;

	}



	public boolean getMoreResults(int arg0) throws SQLException {

		// TODO Auto-generated method stub

		return false;

	}



	public int getResultSetHoldability() throws SQLException {

		// TODO Auto-generated method stub

		return 0;

	}

    

    

    

}

