/*
 * Connection.java
 *
 * Created on August 1, 2007, 6:01 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */
package usda.weru.soil.arssql;

import java.sql.*;
import java.util.Map;

/**
 *This is a stripped implementation of the Connection 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 ConnectionARS implements java.sql.Connection {
    public static void main(String[] args) throws Exception{
        ConnectionARS cars=new ConnectionARS("SDMDataAccess.nrcs.usda.gov");
        StatementARS sars=(StatementARS) cars.createStatement();
        ResultSetARS rsars=sars.executeQuery("SELECT lkey,areasymbol,areaname FROM legend ORDER BY areasymbol");
        System.out.println("m: " + rsars);
        String rtnStr=rsars.getString("areaname");
        System.out.println("areaname = " + rtnStr);
    }

    /** Creates a new instance of Connection */
    public ConnectionARS() {
    }
    String url;

    public ConnectionARS(String url) {
        this.url=url;
    }

//          Clears all warnings reported for this Connection object.
    public void clearWarnings() {
    }

//          Releases this Connection object's database and JDBC resources immediately instead of waiting for them to be automatically released.
    public void close() {
    }

//          Makes all changes made since the previous commit/rollback permanent and releases any database locks currently held by this Connection object.
    public void commit() {
    }

//          Creates a Statement object for sending SQL statements to the database.
//			Used by WEPS -- creates new statement and passes URL to
//			statement.
    public Statement createStatement() {
        return new StatementARS(url);
    }

//          Creates a Statement object that will generate ResultSet objects with the given type and concurrency.public
    public Statement createStatement(int resultSetType, int resultSetConcurrency) {
        return null;
    }

//          Creates a Statement object that will generate ResultSet objects with the given type, concurrency, and holdability.
    public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) {
        return null;
    }

//          Retrieves the current auto-commit mode for this Connection object.
    public boolean getAutoCommit() {
        return false;
    }

//          Retrieves this Connection object's current catalog name.
    public String getCatalog() {
        return null;
    }

//          Retrieves the current holdability of ResultSet objects created using this Connection object.
    public int getHoldability() {
        return -1;
    }

//          Retrieves a DatabaseMetaData object that contains metadata about the database to which this Connection object represents a connection.
    public DatabaseMetaData getMetaData() {
        return null;
    }

//          Retrieves this Connection object's current transaction isolation level.
    public int getTransactionIsolation() {
        return -1;
    }

//          Retrieves the Map object associated with this Connection object.
    public Map<String, Class<?>> getTypeMap() {
        return null;
    }

//          Retrieves the first warning reported by calls on this Connection object.
//			Used by WEPS -- returns null to indicate no warnings.
//			(probably will need to be fixed later)
    public SQLWarning getWarnings() {
        return null;
    }

//          Retrieves whether this Connection object has been closed.
    public boolean isClosed() {
        return false;
    }

//          Retrieves whether this Connection object is in read-only mode.
    public boolean isReadOnly() {
        return true;
    }

//          Converts the given SQL statement into the system's native SQL grammar.
    public String nativeSQL(String sql) {
        return sql;
    }

//          Creates a CallableStatement object for calling database stored procedures.
    public CallableStatement prepareCall(String sql) {
        return null;
    }

//          Creates a CallableStatement object that will generate ResultSet objects with the given type and concurrency.
    public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) {
        return null;
    }

//          Creates a CallableStatement object that will generate ResultSet objects with the given type and concurrency.
    public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) {
        return null;
    }

//          Creates a PreparedStatement object for sending parameterized SQL statements to the database.
    public PreparedStatement prepareStatement(String sql) {
        return null;
    }

//          Creates a default PreparedStatement object that has the capability to retrieve auto-generated keys.
    public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) {
        return null;
    }

//          Creates a default PreparedStatement object capable of returning the auto-generated keys designated by the given array.
    public PreparedStatement prepareStatement(String sql, int[] columnIndexes) {
        return null;
    }

//          Creates a PreparedStatement object that will generate ResultSet objects with the given type and concurrency.
    public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) {
        return null;
    }

//          Creates a PreparedStatement object that will generate ResultSet objects with the given type, concurrency, and holdability.
    public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) {
        return null;
    }

//          Creates a default PreparedStatement object capable of returning the auto-generated keys designated by the given array.
    public PreparedStatement prepareStatement(String sql, String[] columnNames) {
        return null;
    }

//          Removes the given Savepoint object from the current transaction.
    public void releaseSavepoint(Savepoint savepoint) {
    }

//          Undoes all changes made in the current transaction and releases any database locks currently held by this Connection object.
    public void rollback() {
    }

//          Undoes all changes made after the given Savepoint object was set.
    public void rollback(Savepoint savepoint) {
    }

//          Sets this connection's auto-commit mode to the given state.
    public void setAutoCommit(boolean autoCommit) {
    }

//          Sets the given catalog name in order to select a subspace of this Connection object's database in which to work.
    public void setCatalog(String catalog) {
    }

//          Changes the holdability of ResultSet objects created using this Connection object to the given holdability.
    public void setHoldability(int holdability) {
    }

//          Puts this connection in read-only mode as a hint to the driver to enable database optimizations.
    public void setReadOnly(boolean readOnly) {
    }

//          Creates an unnamed savepoint in the current transaction and returns the new Savepoint object that represents it.
    public Savepoint setSavepoint() {
        return null;
    }

//          Creates a savepoint with the given name in the current transaction and returns the new Savepoint object that represents it.
    public Savepoint setSavepoint(String name) {
        return null;
    }

//          Attempts to change the transaction isolation level for this Connection object to the one given.
    public void setTransactionIsolation(int level) {
    }

//			Installs the given TypeMap object as the type map for this Connection object.
    public void setTypeMap(Map<String, Class<?>> map) {
    }

    public Struct createStruct(String s, Object[] oa) {
        return null;
    }

    public Array createArrayOf(String s, Object[] oa) {
        return null;
    }

    public java.util.Properties getClientInfo() {
        return null;
    }

    public String getClientInfo(String s) {
        return null;
    }

    public void setClientInfo(java.util.Properties p) {
    }

    public void setClientInfo(String s1, String s2) {
    }

    public boolean isValid(int i) {
        return false;
    }

    public SQLXML createSQLXML() {
        return null;
    }

    public NClob createNClob() {
        return null;
    }

    public Blob createBlob() {
        return null;
    }

    public Clob createClob() {
        return null;
    }

    public boolean isWrapperFor(Class<?> c) {
        return false;
    }

    public <T> T unwrap(Class<T> t) {
        return null;
    }
}
