## org.eclipse.datatools.connectivity.oda.consumer.helper
Class OdaConnection

    java.lang.Object
      org.eclipse.datatools.connectivity.oda.consumer.helper.OdaObject
          org.eclipse.datatools.connectivity.oda.consumer.helper.OdaConnection

All Implemented Interfaces:
  IConnection

public class OdaConnection
extends org.eclipse.datatools.connectivity.oda.consumer.helper.OdaObject
implements IConnection

OdaConnection is the Oda wrapper for connections.

Method Summary
`void` `clearDriverError()`
`void` `close()` Attempts to close this connection.
`void` `commit()` Commits all changes made since the previous commit/rollback.
`java.lang.Object` `findAndInvokeMethod(java.lang.String methodName, java.lang.Class[] parameterTypes, java.lang.Object[] args)`
`java.lang.String` `getDriverErrorMessage()`
`int` `getDriverErrorNumber()`
`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.
`void` `setLocale(java.lang.String localeString)`
`static void` `setThrowAndSetOdaException()`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### getDriverErrorNumber

    public int getDriverErrorNumber()

### getDriverErrorMessage

    public java.lang.String getDriverErrorMessage()

### clearDriverError

    public void clearDriverError()

### getMaxQueries

    public int getMaxQueries()
                      throws OdaException

  Description copied from interface: `IConnection`
  Returns the maximum number of active queries for any data set types that the driver can support for this connection.

  Specified by:
    `getMaxQueries` in interface `IConnection`
  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

### open

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

  Description copied from interface: `IConnection`
  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.

  Specified by:
    `open` in interface `IConnection`
  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

  Description copied from interface: `IConnection`
  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.

  Specified by:
    `setAppContext` in interface `IConnection`
  Parameters:
    `context` - Application context object of this instance.
  Throws:
    `OdaException` - if data source error occurs

### close

    public void close()
               throws OdaException

  Description copied from interface: `IConnection`
  Attempts to close this connection.

  Specified by:
    `close` in interface `IConnection`
  Throws:
    `OdaException` - if data source error occurs

### isOpen

    public boolean isOpen()
                   throws OdaException

  Description copied from interface: `IConnection`
  Checks whether this has an established connection

  Specified by:
    `isOpen` in interface `IConnection`
  Returns:
    true if connection is established.
  Throws:
    `OdaException` - if data source error occurs

### getMetaData

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

  Description copied from interface: `IConnection`
  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().

  Specified by:
    `getMetaData` in interface `IConnection`
  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

  Description copied from interface: `IConnection`
  Returns an IQuery object of the given data set type. The data set type is implementation-dependent.

  Specified by:
    `newQuery` in interface `IConnection`
  Parameters:
    `dataSetType` - String representation of a data set type.
  Returns:
    an IQuery object.
  Throws:
    `OdaException` - if data source error occurs

### commit

    public void commit()
                throws OdaException

  Description copied from interface: `IConnection`
  Commits all changes made since the previous commit/rollback.
  An optional method.

  Specified by:
    `commit` in interface `IConnection`
  Throws:
    `OdaException` - if data source error occurs

### rollback

    public void rollback()
                  throws OdaException

  Description copied from interface: `IConnection`
  Undoes all changes made since the previous commit/rollback.
  An optional method.

  Specified by:
    `rollback` in interface `IConnection`
  Throws:
    `OdaException` - if data source error occurs

### setLocale

    public void setLocale(java.lang.String localeString)
                   throws java.lang.Throwable

  Throws:
    `java.lang.Throwable`

### setThrowAndSetOdaException

    public static void setThrowAndSetOdaException()

### findAndInvokeMethod

    public java.lang.Object findAndInvokeMethod(java.lang.String methodName,
                                                java.lang.Class[] parameterTypes,
                                                java.lang.Object[] args)
                                         throws java.lang.NoSuchMethodException,
                                                java.lang.IllegalAccessException,
                                                java.lang.reflect.InvocationTargetException,
                                                OdaException

  Throws:
    `java.lang.NoSuchMethodException`
    `java.lang.IllegalAccessException`
    `java.lang.reflect.InvocationTargetException`
    `OdaException`

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