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

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

All Implemented Interfaces:
  IDriver

public class OdaDriver
extends org.eclipse.datatools.connectivity.oda.consumer.helper.OdaObject
implements IDriver

OdaDriver is an ODA consumer helper that wraps and manages an ODA driver instance.

Field Summary
`static java.lang.String` `ODA_BRIDGED_DRIVER`

Constructor Summary
`OdaDriver(ExtensionManifest driverConfig)` Instantiates an ODA consumer's driver helper to manage the specified ODA driver.
`OdaDriver(java.lang.String odaDataSourceId)` Instantiates an ODA consumer's driver helper to manage the specified ODA driver.
`OdaDriver(java.lang.String driverClassName, java.util.Locale locale, java.lang.ClassLoader driverClassloader, boolean switchContextClassloader)` Instantiates an ODA consumer's driver helper to manage the specified ODA driver.

Method Summary
`java.lang.Object` `findAndInvokeMethod(java.lang.String methodName, java.lang.Class[] parameterTypes, java.lang.Object[] args)`
`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).
`void` `setLogDirectory(java.lang.String logDirectory)`
`static void` `setThrowAndSetOdaException()`

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

Field Detail

### ODA_BRIDGED_DRIVER

    public static final java.lang.String ODA_BRIDGED_DRIVER

See Also:
  Constant Field Values

Constructor Detail

### OdaDriver

    public OdaDriver(java.lang.String odaDataSourceId)
              throws OdaException

  Instantiates an ODA consumer's driver helper to manage the specified ODA driver. This uses the OSGi bundle to locate and load the specified ODA driver.

Parameters:
  `odaDataSourceId` - the unique id of the data source element in an ODA data source extension, whose driver is to be loaded and managed by this helper
Throws:
  `OdaException`

### OdaDriver

    public OdaDriver(ExtensionManifest driverConfig)
              throws OdaException

  Instantiates an ODA consumer's driver helper to manage the specified ODA driver. This uses the OSGi bundle to locate and load the specified ODA driver.

Parameters:
  `driverConfig` - the driver configuration info of an ODA data source extension, whose driver is to be loaded and managed by this helper
Throws:
  `OdaException`

### OdaDriver

    public OdaDriver(java.lang.String driverClassName,
                     java.util.Locale locale,
                     java.lang.ClassLoader driverClassloader,
                     boolean switchContextClassloader)
              throws OdaException

  Instantiates an ODA consumer's driver helper to manage the specified ODA driver. This does *not* use the OSGi bundle to locate and load the specified driver class.

Parameters:
  `driverClassName` - full path name of the ODA driver class to load and manage by this helper
  `locale` - deprecated
  `driverClassloader` - the classloader for use to instantiate the underlying driver class; may be null, in which case, this class' own loader is used instead
  `switchContextClassloader` -
Throws:
  `OdaException`

Method Detail

### setLogDirectory

    public void setLogDirectory(java.lang.String logDirectory)

### setLogConfiguration

    public void setLogConfiguration(LogConfiguration logConfig)
                             throws OdaException

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

  Specified by:
    `setLogConfiguration` in interface `IDriver`
  Parameters:
    `logConfig` - The trace logging configuration.
  Throws:
    `OdaException` - if ODA runtime driver error occurs.

### getConnection

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

  Description copied from interface: `IDriver`
  Returns an IConnection object that can then be used to establish a runtime connection to the underlying data source with the given unique id.

  Specified by:
    `getConnection` in interface `IDriver`
  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`

### getMaxConnections

    public int getMaxConnections()
                          throws OdaException

  Description copied from interface: `IDriver`
  Returns the maximum number of concurrent connections that the driver can support.

  Specified by:
    `getMaxConnections` in interface `IDriver`
  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

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

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

### 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.