Class JdbcImport

java.lang.Object
com.illumon.iris.importers.util.ImportBase
com.illumon.iris.importers.util.JdbcImport

public class JdbcImport extends ImportBase
Tools for programmatically executing JDBC batch imports.
  • Field Details

    • log

      public static final com.fishlib.io.logger.Logger log
  • Method Details

    • builder

      public static JdbcImportBuilder builder(String namespace, String table)
      Creates a new JdbcImportBuilder object. Method calls on this object can then be used to configure the import and run it.
      Parameters:
      namespace - The String name of the namespace into which data will be imported.
      table - The String name of the table into which data will be imported.
      Returns:
      A new JdbcImportBuilder object.
    • getServerTimeZone

      public static TimeZone getServerTimeZone(String driver, String connectionUrl, String user, String password) throws SQLException
      Utility method to retrieve database server timezone. Used by default for interpreting dates and times on import.
      Parameters:
      driver - A String of the fully qualified class name of the JDBC driver to use.
      connectionUrl - A String connection URL whose formatting is specified by the driver being used.
      Returns:
      A TimeZone
      Throws:
      SQLException - if the call fails.
    • run

      public long run() throws SQLException, IOException
      Executes a JDBC batch import as configured for the JdbcImport object.
      Specified by:
      run in class ImportBase
      Returns:
      A long of the number of rows imported.
      Throws:
      IOException - or SQLException if the import cannot be executed or fails during processing.
      SQLException