# ImportAdapterJDBC (ARX Developer Documentation)

org.deidentifier.arx.io

## Class ImportAdapterJDBC

- java.lang.Object
- - org.deidentifier.arx.io.ImportAdapter
  - - org.deidentifier.arx.io.ImportAdapterJDBC

- All Implemented Interfaces:
    java.util.Iterator<java.lang.String[]>

      public class ImportAdapterJDBC
      extends ImportAdapter

  Import adapter for JDBC This adapter can import data from JDBC sources. The source itself is described by an appropriate `ImportConfigurationJDBC` object.

- - ### Field Summary

    - ### Fields inherited from class org.deidentifier.arx.io.ImportAdapter

      `dataTypes, header, indexes`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `ImportAdapterJDBC(ImportConfigurationJDBC config)` Creates a new instance of this object with given configuration.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected int[]` | `getIndexesToImport()` Returns an array with indexes of columns that should be imported Only columns listed within `#column` will be imported.
    `int` | `getProgress()` Returns the percentage of data that has already been returned This divides the number of rows that have already been returned by the number of total rows and casts the result into a percentage.
    `boolean` | `hasNext()` Indicates whether there is another element to return This returns true when there is another element in the result set `resultSet`.
    `java.lang.String[]` | `next()`
    `void` | `remove()` Dummy.

    - ### Methods inherited from class org.deidentifier.arx.io.ImportAdapter

      `create, getColumnDatatypes, getConfig, getHeader`

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

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

- - ### Constructor Detail

    - #### ImportAdapterJDBC

          protected ImportAdapterJDBC(ImportConfigurationJDBC config)
                               throws java.io.IOException

      Creates a new instance of this object with given configuration.
      Parameters:
        `config` - `config`
      Throws:
        `java.io.IOException` - In case of communication errors with JDBC

  - ### Method Detail

    - #### getProgress

          public int getProgress()

      Returns the percentage of data that has already been returned This divides the number of rows that have already been returned by the number of total rows and casts the result into a percentage. In case of an `SQLException` 0 will be returned.
      Specified by:
        `getProgress` in class `ImportAdapter`
      Returns:

    - #### hasNext

          public boolean hasNext()

      Indicates whether there is another element to return This returns true when there is another element in the result set `resultSet`.
      Returns:

    - #### next

          public java.lang.String[] next()

    - #### remove

          public void remove()

      Dummy.

    - #### getIndexesToImport

          protected int[] getIndexesToImport()

      Returns an array with indexes of columns that should be imported Only columns listed within `#column` will be imported. This iterates over the list of columns and returns an array with indexes of columns that should be imported.
      Returns:
        Array containing indexes of columns that should be imported