## org.eclipse.datatools.connectivity.oda
Interface IConnection

public interface IConnection

A data source connection interface used to establish a live connection to the underlying data provider.

Method Summary
`void` `close()` Attempts to close this connection.
`void` `commit()` Commits all changes made since the previous commit/rollback.
`int` `getMaxQueries()` Returns the maximum number of active queries for any data set types that the driver can support for this connection.
`IDataSetMetaData` `getMetaData(java.lang.String dataSetType)` Returns an IDataSetMetaData object of the the given data set type.
`boolean` `isOpen()` Checks whether this has an established connection
`IQuery` `newQuery(java.lang.String dataSetType)` Returns an IQuery object of the given data set type.
`void` `open(java.util.Properties connProperties)` Attempts to establish a connection based on the given connection properties.
`void` `rollback()` Undoes all changes made since the previous commit/rollback.
`void` `setAppContext(java.lang.Object context)` Sets the connection context passed through from an application.

Method Detail

### open

    public void open(java.util.Properties connProperties)
              throws OdaException

  Attempts to establish a connection based on the given connection properties. It is up to individual ODA driver to process the properties.
  Note: An ODA driver may use the `org.eclipse.datatools.connectivity.oda.util.manifest` utility package to obtain information on itself, such as the content of its plug-in manifest and the driver's installation location.

  Parameters:
    `connProperties` - Properties necessary to establish a connection.
  Throws:
    `OdaException` - if data source error occurs

### setAppContext

    public void setAppContext(java.lang.Object context)
                       throws OdaException

  Sets the connection context passed through from an application. Its handling is specific to individual driver implementation. The context argument could be null. The method may be called by an ODA consumer application with a null argument, i.e. passing a null context object to this instance, only if a non-null context was previously passed through to the same instance.
  Note: This method should be called before open(). It is called regardless of whether the connection is already open.
  An optional method. If any part of the context is not recognized by the driver, it should simply ignore, and not throw an exception.

  Parameters:
    `context` - Application context object of this instance.
  Throws:
    `OdaException` - if data source error occurs
  Since:
    3.0

### close

    public void close()
               throws OdaException

  Attempts to close this connection.

  Throws:
    `OdaException` - if data source error occurs

### isOpen

    public boolean isOpen()
                   throws OdaException

  Checks whether this has an established connection

  Returns:
    true if connection is established.
  Throws:
    `OdaException` - if data source error occurs

### getMetaData

    public IDataSetMetaData getMetaData(java.lang.String dataSetType)
                                 throws OdaException

  Returns an IDataSetMetaData object of the the given data set type. The data set type is implementation-dependent. This can be called before this IConnection is opened; however some IDataSetMetaData methods expects and requires an opened connection before being called, e.g. getDataSourceObjects().

  Parameters:
    `dataSetType` - String representation of a data set type.
  Returns:
    an IDataSetMetaData object.
  Throws:
    `OdaException` - if data source error occurs

### newQuery

    public IQuery newQuery(java.lang.String dataSetType)
                    throws OdaException

  Returns an IQuery object of the given data set type. The data set type is implementation-dependent.

  Parameters:
    `dataSetType` - String representation of a data set type.
  Returns:
    an IQuery object.
  Throws:
    `OdaException` - if data source error occurs

### getMaxQueries

    public int getMaxQueries()
                      throws OdaException

  Returns the maximum number of active queries for any data set types that the driver can support for this connection.

  Returns:
    the maximum number of any type of queries that can be prepared and executed concurrently, or 0 if there is no limit or the limit is unknown.
  Throws:
    `OdaException` - if driver error occurs

### commit

    public void commit()
                throws OdaException

  Commits all changes made since the previous commit/rollback.
  An optional method.

  Throws:
    `OdaException` - if data source error occurs

### rollback

    public void rollback()
                  throws OdaException

  Undoes all changes made since the previous commit/rollback.
  An optional method.

  Throws:
    `OdaException` - if data source error occurs

Copyright © 2006 Actuate, IBM Corporation, Sybase, Inc. and others. All rights reserved.