Class JdbcHelpers

java.lang.Object
com.illumon.iris.db.tables.utils.JdbcHelpers

public class JdbcHelpers
extends Object
Tools for reading data from a JDBC source into an in-memory Deephaven table.
  • Constructor Details

  • Method Details

    • readJdbc

      public static Table readJdbc​(String jdbcDriver, String jdbcUrl, String user, String password, String query) throws IOException, SQLException
      Return a JDBC query result as an in-memory Deephaven table. Standard JDBC-to-Deephaven type mapping applies.
      Parameters:
      jdbcDriver - JDBC driver to use
      jdbcUrl - JDBC URL/connection string
      user - JDBC user
      password - JDBC password
      query - an SQL query
      Returns:
      in memory table with results of the given query
      Throws:
      IOException - if an error occurs with Schema generation or table writing
      SQLException - is a JDBC related error occurs
    • readJdbc

      public static Table readJdbc​(String jdbcDriver, String jdbcUrl, String user, String password, String query, JdbcHelpers.ReadJdbcOptions options) throws IOException, SQLException
      Return a JDBC query result as an in-memory Deephaven table. Standard JDBC-to-Deephaven type mapping applies.
      Parameters:
      jdbcDriver - JDBC driver to use
      jdbcUrl - JDBC URL/connection string
      user - JDBC user
      password - JDBC password
      query - an SQL query
      options - options to apply to the read/mapping operation
      Returns:
      in memory table with results of the given query
      Throws:
      IOException - if an error occurs with Schema generation or table writing
      SQLException - is a JDBC related error occurs
    • readJdbc

      public static Table readJdbc​(String jdbcDriver, String jdbcUrl, String query) throws IOException, SQLException
      Return a JDBC query result as an in-memory Deephaven table. Standard JDBC-to-Deephaven type mapping applies.
      Parameters:
      jdbcDriver - JDBC driver to use
      jdbcUrl - JDBC URL/connection string
      query - an SQL query
      Returns:
      in memory table with results of the given query
      Throws:
      IOException - if an error occurs with Schema generation or table writing
      SQLException - if a JDBC-related error occurs
    • readJdbc

      public static Table readJdbc​(String jdbcDriver, String jdbcUrl, String query, JdbcHelpers.ReadJdbcOptions options) throws IOException, SQLException
      Return a JDBC query result as an in-memory Deephaven table. Standard JDBC-to-Deephaven type mapping applies.
      Parameters:
      jdbcDriver - JDBC driver to use
      jdbcUrl - JDBC URL/connection string
      query - an SQL query
      options - options to apply to the read/mapping operation
      Returns:
      in memory table with results of the given query
      Throws:
      IOException - if an error occurs with Schema generation or table writing
      SQLException - if a JDBC-related error occurs
    • readJdbc

      public static Table readJdbc​(String jdbcDriver, String jdbcUrl, String user, String password, String catalog, String schema, String query, JdbcHelpers.ReadJdbcOptions options) throws IOException, SQLException
      Return a JDBC query result as an in-memory Deephaven table. Standard JDBC-to-Deephaven type mapping applies.
      Parameters:
      jdbcDriver - JDBC driver to use
      jdbcUrl - JDBC URL/connection string
      user - JDBC user
      password - JDBC password
      catalog - the desired JDBC system catalog (specify null for default)
      schema - the desired JDBC schema (specify null for default)
      query - an SQL query
      options - options to apply to the read/mapping operation
      Returns:
      in memory table with results of the given query
      Throws:
      IOException - if an error occurs with Schema generation or table writing
      SQLException - if a JDBC-related error occurs
    • readJdbc

      public static Table readJdbc​(ResultSet resultSet) throws IOException
      Return a JDBC query result as an in-memory Deephaven table. Standard JDBC-to-Deephaven type mapping applies.
      Parameters:
      resultSet - an open JDBC ResultSet
      Returns:
      in memory table with results of the given ResultSet
      Throws:
      IOException - if an error occurs with Schema generation or table writing
    • readJdbc

      public static Table readJdbc​(ResultSet resultSet, StatusCallback progress) throws IOException
      Return a JDBC query result as an in-memory Deephaven table. Standard JDBC-to-Deephaven type mapping applies.
      Parameters:
      resultSet - an open JDBC ResultSet
      progress - status callback
      Returns:
      in memory table with results of the given ResultSet
      Throws:
      IOException - if an error occurs with Schema generation or table writing
    • readJdbc

      public static Table readJdbc​(ResultSet resultSet, JdbcHelpers.ReadJdbcOptions options, StatusCallback progress) throws IOException
      Return a JDBC query result as an in-memory Deephaven table. Standard JDBC-to-Deephaven type mapping applies.
      Parameters:
      resultSet - an open JDBC ResultSet
      options - options to apply to the read/mapping operation
      progress - status callback
      Returns:
      in memory table with results of the given ResultSet
      Throws:
      IOException - if an error occurs with Schema generation or table writing
    • readJdbcOptions

      public static JdbcHelpers.ReadJdbcOptions readJdbcOptions()
      Returns a new options object that the user can use to customize a readJdbc operation.
      Returns:
      a new ReadJdbcOptions object