/*
 * Statement.java
 *
 * Created on August 1, 2007, 6:02 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package usda.weru.soil.arssql;

import java.sql.*;

/**
 * This is a stripped implementation of the Statement interface. It is
 * intended to be used the ARS soap web service to obtain soil data.
 * Only calls that are actually used by WEPS are implemented.
 *
 * @author wjr
 */
public class StatementARS implements java.sql.Statement {
    
    /** Creates a new instance of Statement */
    public StatementARS() {
    }
    
    String url;

	/**
	 *
	 * @param url
	 */
	public StatementARS(String url) {
        this.url = url;
    }
    
//          Adds the given SQL command to the current list of commmands for this Statement object.

	/**
	 *
	 * @param sql
	 */
	    @Override
    public void 	addBatch(String sql) {}
    
//          Cancels this Statement object if both the DBMS and driver support aborting an SQL statement.

	/**
	 *
	 */
	    @Override
    public void 	cancel() {}
    
//          Empties this Statement object's current list of SQL commands.

	/**
	 *
	 */
	    @Override
    public void 	clearBatch() {}
    
//          Clears all the warnings reported on this Statement object.

	/**
	 *
	 */
	    @Override
    public void 	clearWarnings() {}
    
//          Releases this Statement object's database and JDBC resources immediately instead of waiting for this to happen when it is automatically closed.

	/**
	 *
	 */
	    @Override
    public void 	close() {}
    
//          Executes the given SQL statement, which may return multiple results.

	/**
	 *
	 * @param sql
	 * @return
	 */
	    @Override
    public boolean 	execute(String sql) {return false;}
    
//          Executes the given SQL statement, which may return multiple results, and signals the driver that any auto-generated keys should be made available for retrieval.

	/**
	 *
	 * @param sql
	 * @param autoGeneratedKeys
	 * @return
	 */
	    @Override
    public boolean 	execute(String sql, int autoGeneratedKeys) {return false;}
    
//          Executes the given SQL statement, which may return multiple results, and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval.

	/**
	 *
	 * @param sql
	 * @param columnIndexes
	 * @return
	 */
	    @Override
    public boolean 	execute(String sql, int[] columnIndexes) {return false;}
    
//          Executes the given SQL statement, which may return multiple results, and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval.

	/**
	 *
	 * @param sql
	 * @param columnNames
	 * @return
	 */
	    @Override
    public boolean 	execute(String sql, String[] columnNames) {return false;}
    
//          Submits a batch of commands to the database for execution and if all commands execute successfully, returns an array of update counts.

	/**
	 *
	 * @return
	 */
	    @Override
    public int[] 	executeBatch() {return null;}
    
//          Executes the given SQL statement, which returns a single ResultSet object.
//			Called by WEPS

	/**
	 *
	 * @param query
	 * @return
	 * @throws SQLException
	 */
	    @Override
    public ResultSetARS 	executeQuery(String query) throws SQLException{
//        System.out.println("eQ: " + query);            
                CommunicateWithARS cwa = new CommunicateWithARS(url, query);
                return new ResultSetARS(cwa.getXMLDoc());

    }
    
//          Executes the given SQL statement, which may be an INSERT, UPDATE, or DELETE statement or an SQL statement that returns nothing, such as an SQL DDL statement.

	/**
	 *
	 * @param sql
	 * @return
	 */
	    @Override
    public int 	executeUpdate(String sql) {return -1;}
    
//          Executes the given SQL statement and signals the driver with the given flag about whether the auto-generated keys produced by this Statement object should be made available for retrieval.

	/**
	 *
	 * @param sql
	 * @param autoGeneratedKeys
	 * @return
	 */
	    @Override
    public int 	executeUpdate(String sql, int autoGeneratedKeys) {return -1;}
    
//          Executes the given SQL statement and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval.

	/**
	 *
	 * @param sql
	 * @param columnIndexes
	 * @return
	 */
	    @Override
    public int 	executeUpdate(String sql, int[] columnIndexes) {return -1;}
    
//          Executes the given SQL statement and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval.

	/**
	 *
	 * @param sql
	 * @param columnNames
	 * @return
	 */
	    @Override
    public int 	executeUpdate(String sql, String[] columnNames) {return -1;}
    
//          Retrieves the Connection object that produced this Statement object.

	/**
	 *
	 * @return
	 * @throws SQLException
	 */
	    @Override
    public java.sql.Connection 	getConnection() throws SQLException {return  null;}
    
//          Retrieves the direction for fetching rows from database tables that is the default for result sets generated from this Statement object.

	/**
	 *
	 * @return
	 */
	    @Override
    public int 	getFetchDirection() {return -1;}
    
//          Retrieves the number of result set rows that is the default fetch size for ResultSet objects generated from this Statement object.

	/**
	 *
	 * @return
	 */
	    @Override
    public int 	getFetchSize() {return -1;}
    
//          Retrieves any auto-generated keys created as a result of executing this Statement object.

	/**
	 *
	 * @return
	 */
	    @Override
    public ResultSetARS 	getGeneratedKeys() {return null;}
    
//          Retrieves the maximum number of bytes that can be returned for character and binary column values in a ResultSet object produced by this Statement object.

	/**
	 *
	 * @return
	 */
	    @Override
    public int 	getMaxFieldSize() {return -1;}
    
//          Retrieves the maximum number of rows that a ResultSet object produced by this Statement object can contain.

	/**
	 *
	 * @return
	 */
	    @Override
    public int 	getMaxRows() {return -1;}
    
//          Moves to this Statement object's next result, returns true if it is a ResultSet object, and implicitly closes any current ResultSet object(s) {} obtained with the method getResultSet.

	/**
	 *
	 * @return
	 */
	    @Override
    public boolean 	getMoreResults() {return false;}
    
//          Moves to this Statement object's next result, deals with any current ResultSet object(s) {} according to the instructions specified by the given flag, and returns true if the next result is a ResultSet object.

	/**
	 *
	 * @param current
	 * @return
	 */
	    @Override
    public boolean 	getMoreResults(int current) {return false;}
    
//          Retrieves the number of seconds the driver will wait for a Statement object to execute.

	/**
	 *
	 * @return
	 */
	    @Override
    public int 	getQueryTimeout() {return -1;}
    
//          Retrieves the current result as a ResultSet object.

	/**
	 *
	 * @return
	 */
	    @Override
    public ResultSetARS 	getResultSet() {return null;}
    
//          Retrieves the result set concurrency for ResultSet objects generated by this Statement object.

	/**
	 *
	 * @return
	 */
	    @Override
    public int 	getResultSetConcurrency() {return -1;}
    
//          Retrieves the result set holdability for ResultSet objects generated by this Statement object.

	/**
	 *
	 * @return
	 */
	    @Override
    public int 	getResultSetHoldability() {return -1;}
    
//          Retrieves the result set type for ResultSet objects generated by this Statement object.

	/**
	 *
	 * @return
	 */
	    @Override
    public int 	getResultSetType() {return -1;}
    
//          Retrieves the current result as an update count; if the result is a ResultSet object or there are no more results, -1 is returned.

	/**
	 *
	 * @return
	 */
	    @Override
    public int 	getUpdateCount() {return -1;}
    
//          Retrieves the first warning reported by calls on this Statement object.

	/**
	 *
	 * @return
	 */
	    @Override
    public SQLWarning 	getWarnings() {return null;}
    
//          Sets the SQL cursor name to the given String, which will be used by subsequent Statement object execute methods.

	/**
	 *
	 * @param name
	 */
	    @Override
    public void 	setCursorName(String name) {}
    
//          Sets escape processing on or off.

	/**
	 *
	 * @param enable
	 */
	    @Override
    public void 	setEscapeProcessing(boolean enable) {}
    
//          Gives the driver a hint as to the direction in which rows will be processed in ResultSet objects created using this Statement object.

	/**
	 *
	 * @param direction
	 */
	    @Override
    public void 	setFetchDirection(int direction) {}
    
//          Gives the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed.

	/**
	 *
	 * @param rows
	 */
	    @Override
    public void 	setFetchSize(int rows) {}
    
//          Sets the limit for the maximum number of bytes in a ResultSet column storing character or binary values to the given number of bytes.

	/**
	 *
	 * @param max
	 */
	    @Override
    public void 	setMaxFieldSize(int max) {}
    
//          Sets the limit for the maximum number of rows that any ResultSet object can contain to the given number.

	/**
	 *
	 * @param max
	 */
	    @Override
    public void 	setMaxRows(int max) {}
    
//          Sets the number of seconds the driver will wait for a Statement object to execute to the given number of seconds.

	/**
	 *
	 * @param seconds
	 */
	    @Override
    public void 	setQueryTimeout(int seconds) {}

	/**
	 *
	 * @return
	 */
	@Override
    public boolean isPoolable() {return false;}

	/**
	 *
	 * @param b
	 */
	@Override
    public void setPoolable(boolean b) {}

	/**
	 *
	 * @return
	 */
	@Override
    public boolean isClosed() {return false;}

	/**
	 *
	 * @param c
	 * @return
	 */
	@Override
    public boolean isWrapperFor(Class<?> c) {return false;}

	/**
	 *
	 * @param <T>
	 * @param t
	 * @return
	 */
	@Override
    public <T> T unwrap(Class<T> t) {return null;}
    
    // LEW Jim Ascough's programmers added this to allow compilation/running under Java 7

	/**
	 *
	 * @throws SQLException
	 */
	    @Override
	public void closeOnCompletion() throws SQLException {
		throw new UnsupportedOperationException("Not supported yet.");
	}

	//@Override

	/**
	 *
	 * @return
	 * @throws SQLException
	 */
	    @Override
	public boolean isCloseOnCompletion() throws SQLException {
		throw new UnsupportedOperationException("Not supported yet.");
	}
}
