com.ihr.xbrl.manage

## Class ExternalDriverApp

- java.lang.Object
- - com.ihr.xbrl.manage.ExternalDriverApp

-     public class ExternalDriverApp
      extends java.lang.Object

  The Class ExternalDriverApp.
  Author:
    Ignacio

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ExternalDriverApp.Status` The Enum Status.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `EXTERNAL_DIALECT_CLASS_PREFIX` The property value is the class in the previous jar that implements java.sql.Driver
    `static java.lang.String` | `EXTERNAL_DIALECT_JAR_PREFIX` The property value is the Jar URL.
    `static java.lang.String` | `EXTERNAL_DRIVER_CLASS_PREFIX` The property value is the class in the previous jar that implements java.sql.Driver
    `static java.lang.String` | `EXTERNAL_DRIVER_JAR_PREFIX` The property value is the Jar URL.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ExternalDriverApp(HasProperties app)` Creates an instance of the ExternalDriverApp to allow an application to dynamically load jar files that contains a class that implements a driver to connect to a database.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `externalJarAndClassesToProperties()` External jar and classes to properties.
    `java.lang.String` | `getExternalDialectClass()` Gets the external dialect class.
    `java.lang.String` | `getExternalDialectJar()` Gets the external dialect jar.
    `java.lang.String` | `getExternalDriverClass()` Gets the external driver class.
    `java.lang.String` | `getExternalDriverJar()` Gets the external driver jar.
    `java.lang.Throwable` | `getLastError()` Gets the last error.
    `ExternalDriverApp.Status` | `getStatus()` Gets the status.
    `void` | `loadDriver()` Load driver.
    `void` | `propertiesToExternalJarAndClasses()` Properties to external jar and classes.
    `java.lang.Thread` | `setContextClassLoader(java.lang.Thread th)` Sets the context class loader.
    `void` | `setExternalDialect(java.lang.String jar, java.lang.String _class)` Sets the external dialect.
    `void` | `setExternalDriver(java.lang.String jar, java.lang.String _class)` Sets the external driver.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### EXTERNAL_DRIVER_JAR_PREFIX

          public static java.lang.String EXTERNAL_DRIVER_JAR_PREFIX

      The property value is the Jar URL.

    - #### EXTERNAL_DRIVER_CLASS_PREFIX

          public static java.lang.String EXTERNAL_DRIVER_CLASS_PREFIX

      The property value is the class in the previous jar that implements java.sql.Driver

    - #### EXTERNAL_DIALECT_JAR_PREFIX

          public static java.lang.String EXTERNAL_DIALECT_JAR_PREFIX

      The property value is the Jar URL.

    - #### EXTERNAL_DIALECT_CLASS_PREFIX

          public static java.lang.String EXTERNAL_DIALECT_CLASS_PREFIX

      The property value is the class in the previous jar that implements java.sql.Driver

  - ### Constructor Detail

    - #### ExternalDriverApp

          public ExternalDriverApp(HasProperties app)

      Creates an instance of the ExternalDriverApp to allow an application to dynamically load jar files that contains a class that implements a driver to connect to a database.

      after creating an instance of this class, the application can call `propertiesToExternalJarAndClasses()` in order to load the information from properties in the application. Then, another call to `loadDriver()` will setup the class loader to find the user defined class

      Parameters:
        `app` - this is the parent application class that can provide properties where the class name and jar is stored

  - ### Method Detail

    - #### getExternalDriverClass

          public java.lang.String getExternalDriverClass()

      Gets the external driver class.
      Returns:
        the external driver class

    - #### getExternalDriverJar

          public java.lang.String getExternalDriverJar()

      Gets the external driver jar.
      Returns:
        the external driver jar

    - #### getExternalDialectClass

          public java.lang.String getExternalDialectClass()

      Gets the external dialect class.
      Returns:
        the external dialect class

    - #### getExternalDialectJar

          public java.lang.String getExternalDialectJar()

      Gets the external dialect jar.
      Returns:
        the externalDialectJar

    - #### getStatus

          public ExternalDriverApp.Status getStatus()

      Gets the status.
      Returns:
        the status

    - #### getLastError

          public java.lang.Throwable getLastError()

      Gets the last error.
      Returns:
        the lastError

    - #### setExternalDriver

          public void setExternalDriver(java.lang.String jar,
                               java.lang.String _class)

      Sets the external driver.
      Parameters:
        `jar` - the jar
        `_class` - the _class

    - #### setExternalDialect

          public void setExternalDialect(java.lang.String jar,
                                java.lang.String _class)

      Sets the external dialect.
      Parameters:
        `jar` - the jar
        `_class` - the _class

    - #### propertiesToExternalJarAndClasses

          public void propertiesToExternalJarAndClasses()

      Properties to external jar and classes.

    - #### loadDriver

          public void loadDriver()

      Load driver.

    - #### setContextClassLoader

          public java.lang.Thread setContextClassLoader(java.lang.Thread th)

      Sets the context class loader.
      Parameters:
        `th` - the th
      Returns:
        the same thread with modified context class loader

    - #### externalJarAndClassesToProperties

          public void externalJarAndClassesToProperties()

      External jar and classes to properties.