- java.lang.Object
-
- com.pervasive.datarush.operators.AbstractLogicalOperator
-
- com.pervasive.datarush.operators.CompositeOperator
-
- com.pervasive.datarush.operators.io.jdbc.JDBCOperator
-
- All Implemented Interfaces:
ConnectionSettings,LogicalOperator
- Direct Known Subclasses:
AbstractWriteToJDBC,ReadFromJDBC
public abstract class JDBCOperator extends CompositeOperator implements ConnectionSettings
Common base class forReadFromJDBCandAbstractWriteToJDBC. Exposes configuration properties common to both;
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConnectionFactorygetConnectionFactory()Returns the connection factory to be used for creating connections.StringgetDriverName()Retrieves the class name of the JDBC driver to use.ErrorActiongetErrorAction()Retrieves the action to take if a SQL error occurs while reading data from the database.List<String>getHostNames()Get the list of configured database host names.protected JDBCConnectorgetJDBCConnector()StringgetPassword()Retrieves the password for connecting to the database.intgetSqlWarningLimit()Retrieves the maximum number of warnings regarding SQL errors that an operator can emit.StringgetTableName()Retrieves the name of the database table to access.StringgetUrl()Retrieves the URL for connecting to the database.StringgetUser()Retrieves the user name for connecting to the database.voidsetConnectionFactory(ConnectionFactory connectionFactory)Sets the connection factory to be used for creating connections.voidsetDriverName(String driverName)Sets the class name of the JDBC driver to use, for example:"sun.jdbc.odbc.JdbcOdbcDriver".voidsetErrorAction(ErrorAction errorAction)Sets the action to take if a SQL error occurs while reading data from the database.voidsetHostNames(String... hostNames)Set the list of database host names that can be used to execute queries.voidsetHostNames(List<String> hostNames)Set the list of database host names that can be used to execute queries.protected voidsetJDBCConnector(JDBCConnector jdbcConnector)voidsetPassword(String password)Sets the password for connecting to the database.voidsetSqlWarningLimit(int sqlWarningLimit)Set the maximum number of warnings regarding SQL errors that an operator can emit.voidsetTableName(String tableName)Sets the name of the database table to access.voidsetUrl(String url)Sets the URL for connecting to the database, for example:jdbc:odbc:SampleTest.voidsetUser(String user)Sets the user name for connecting to the database.-
Methods inherited from class com.pervasive.datarush.operators.CompositeOperator
compose
-
Methods inherited from class com.pervasive.datarush.operators.AbstractLogicalOperator
disableParallelism, getInputPorts, getOutputPorts, newInput, newInput, newOutput, newRecordInput, newRecordInput, newRecordOutput, notifyError
-
-
-
-
Method Detail
-
getDriverName
public final String getDriverName()
Retrieves the class name of the JDBC driver to use.- Specified by:
getDriverNamein interfaceConnectionSettings- 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:
getPasswordin interfaceConnectionSettings- 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:
getUrlin interfaceConnectionSettings- 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:
getUserin interfaceConnectionSettings- 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 byWriteToJDBC, but optional forReadFromJDBC, sinceReadFromJDBC.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#errorActionisErrorAction.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 toDefaultConnectionFactory.- 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 toDefaultConnectionFactory.- 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)
-
-