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

All Known Implementing Classes:
  OdaDriver

public interface IDriver

The entry point to a custom ODA run-time driver’s implementation. It is also a connection factory used to produce an IConnection object.

Method Summary
`IConnection` `getConnection(java.lang.String dataSourceId)` Returns an IConnection object that can then be used to establish a runtime connection to the underlying data source with the given unique id.
`int` `getMaxConnections()` Returns the maximum number of concurrent connections that the driver can support.
`void` `setAppContext(java.lang.Object context)` Sets the driver context passed through from an application.
`void` `setLogConfiguration(LogConfiguration logConfig)` An optional method to set the trace logging configuration of the ODA runtime driver for the given type of data source and its runtime connection(s).

Method Detail

### getConnection

    public IConnection getConnection(java.lang.String dataSourceId)
                              throws OdaException

  Returns an IConnection object that can then be used to establish a runtime connection to the underlying data source with the given unique id.

  Parameters:
    `dataSourceId` - The id of a type of data source supported by this IDriver. This matches the data source element id defined in the data source driver's configuration file. A null or empty String will use the default data source type supported by this IDriver.
  Returns:
    an IConnection object
  Throws:
    `OdaException` - if data source error occurs.
  See Also:
    `IConnection`

### setLogConfiguration

    public void setLogConfiguration(LogConfiguration logConfig)
                             throws OdaException

  An optional method to set the trace logging configuration of the ODA runtime driver for the given type of data source and its runtime connection(s).

  Parameters:
    `logConfig` - The trace logging configuration.
  Throws:
    `OdaException` - if ODA runtime driver error occurs.

### getMaxConnections

    public int getMaxConnections()
                          throws OdaException

  Returns the maximum number of concurrent connections that the driver can support.

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

### setAppContext

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

  Sets the driver 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 getConnection( String ).
  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

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