Class SQLDBConfig

java.lang.Object
org.tribuo.data.sql.SQLDBConfig
All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.config.Configurable, com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>

public class SQLDBConfig extends Object implements com.oracle.labs.mlrg.olcut.config.Configurable, com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
N.B. This class accepts raw SQL strings and executes them directly via JDBC. It DOES NOT perform any SQL escaping or other injection prevention. It is the user's responsibility to ensure that SQL passed to this class performs as desired. SQL database configuration. If you specify the host, port, and db strings and use oracle.jdbc.OracleDriver as your JDBC Driver, then this will automatically generate a connectionString, otherwise it must be specified manually and host, port, and db fields can be omitted. DriverManager's default logic will be used to determine which Driver to use for a given connection string.
  • Constructor Details

  • Method Details

    • postConfig

      public void postConfig()
      Used by the OLCUT configuration system, and should not be called by external code.
      Specified by:
      postConfig in interface com.oracle.labs.mlrg.olcut.config.Configurable
    • getConnection

      public Connection getConnection() throws SQLException
      Constructs a connection based on the object fields.
      Returns:
      A connection to the database.
      Throws:
      SQLException - If the connection failed.
    • getStatement

      public Statement getStatement() throws SQLException
      Constructs a statement based on the object fields. Uses fetchSize to determine fetch size and sets defaults for querying data.
      Returns:
      A statement object for querying the database.
      Throws:
      SQLException - If the connection failed.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getProvenance

      public com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance getProvenance()
      Specified by:
      getProvenance in interface com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>