Class JDBCOperator

All Implemented Interfaces:
ConnectionSettings, LogicalOperator
Direct Known Subclasses:
AbstractWriteToJDBC, ReadFromJDBC

public abstract class JDBCOperator extends CompositeOperator implements ConnectionSettings
Common base class for ReadFromJDBC and AbstractWriteToJDBC. Exposes configuration properties common to both;
  • Method Details

    • getDriverName

      public final String getDriverName()
      Retrieves the class name of the JDBC driver to use.
      Specified by:
      getDriverName in interface ConnectionSettings
      Returns:
      the class name of the JDBC driver to use
    • setDriverName

      public final void setDriverName(String driverName)
      Sets the class name of the JDBC driver to use, for example: "sun.jdbc.odbc.JdbcOdbcDriver".
      Parameters:
      driverName - the class name of the JDBC driver to use
    • getPassword

      public final String getPassword()
      Retrieves the password for connecting to the database.
      Specified by:
      getPassword in interface ConnectionSettings
      Returns:
      the password for connecting to the database
    • setPassword

      public final void setPassword(String password)
      Sets the password for connecting to the database.
      Parameters:
      password - the password for connecting to the database
    • getUrl

      public final String getUrl()
      Retrieves the URL for connecting to the database.
      Specified by:
      getUrl in interface ConnectionSettings
      Returns:
      the URL for connecting to the database
    • setUrl

      public void setUrl(String url)
      Sets the URL for connecting to the database, for example: jdbc:odbc:SampleTest.
      Parameters:
      url - the URL for connecting to the database
    • getUser

      public final String getUser()
      Retrieves the user name for connecting to the database.
      Specified by:
      getUser in interface ConnectionSettings
      Returns:
      the user name for connecting to the database
    • setUser

      public final void setUser(String user)
      Sets the user name for connecting to the database.
      Parameters:
      user - the user name for connecting to the database
    • getTableName

      public final String getTableName()
      Retrieves the name of the database table to access.
      Returns:
      the name of the database table to access
    • setTableName

      public final void setTableName(String tableName)
      Sets the name of the database table to access. The table name is required by WriteToJDBC, but optional for ReadFromJDBC, since ReadFromJDBC.setSelectStatement(String) may be used instead.
      Parameters:
      tableName - the name of the database table to access
    • getErrorAction

      public final ErrorAction getErrorAction()
      Retrieves the action to take if a SQL error occurs while reading data from the database.
      Returns:
      the action to take if a SQL error occurs while reading data from the database
    • setErrorAction

      public final void setErrorAction(ErrorAction errorAction)
      Sets the action to take if a SQL error occurs while reading data from the database.

      The default value is ErrorAction.ABORT.

      Parameters:
      errorAction - the action to take if a SQL error occurs
    • getSqlWarningLimit

      public final int getSqlWarningLimit()
      Retrieves the maximum number of warnings regarding SQL errors that an operator can emit.
      Returns:
      the maximum number of warnings regarding SQL errors that an operator can emit
    • setSqlWarningLimit

      public final void setSqlWarningLimit(int sqlWarningLimit)
      Set the maximum number of warnings regarding SQL errors that an operator can emit. This property is only used if #errorAction is ErrorAction.WARN.

      The default value is 100.

      Parameters:
      sqlWarningLimit - the maximum number of warnings regarding SQL errors that an operator can emit
    • getConnectionFactory

      public final ConnectionFactory getConnectionFactory()
      Returns the connection factory to be used for creating connections. Defaults to DefaultConnectionFactory.
      Returns:
      the connection factory to be used for creating connections.
    • setConnectionFactory

      public final void setConnectionFactory(ConnectionFactory connectionFactory)
      Sets the connection factory to be used for creating connections. Defaults to DefaultConnectionFactory.
      Parameters:
      connectionFactory - the connection factory to be used for creating connections.
    • getHostNames

      public List<String> getHostNames()
      Get the list of configured database host names.
      Returns:
      database host names
    • setHostNames

      public void setHostNames(List<String> hostNames)
      Set the list of database host names that can be used to execute queries. This is an optional parameter this is only valid for databases that support multiple database hosts for executing queries.
      Parameters:
      hostNames - list of database host names
    • setHostNames

      public void setHostNames(String... hostNames)
      Set the list of database host names that can be used to execute queries. This is an optional parameter this is only valid for databases that support multiple database hosts for executing queries.
      Parameters:
      hostNames - list of database host names
    • getJDBCConnector

      protected JDBCConnector getJDBCConnector()
    • setJDBCConnector

      protected void setJDBCConnector(JDBCConnector jdbcConnector)