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
Common base class for
ReadFromJDBC and AbstractWriteToJDBC.
Exposes configuration properties common to both;-
Method Summary
Modifier and TypeMethodDescriptionfinal ConnectionFactoryReturns the connection factory to be used for creating connections.final StringRetrieves the class name of the JDBC driver to use.final ErrorActionRetrieves the action to take if a SQL error occurs while reading data from the database.Get the list of configured database host names.protected JDBCConnectorfinal StringRetrieves the password for connecting to the database.final intRetrieves the maximum number of warnings regarding SQL errors that an operator can emit.final StringRetrieves the name of the database table to access.final StringgetUrl()Retrieves the URL for connecting to the database.final StringgetUser()Retrieves the user name for connecting to the database.final voidsetConnectionFactory(ConnectionFactory connectionFactory) Sets the connection factory to be used for creating connections.final voidsetDriverName(String driverName) Sets the class name of the JDBC driver to use, for example:"sun.jdbc.odbc.JdbcOdbcDriver".final 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) final voidsetPassword(String password) Sets the password for connecting to the database.final voidsetSqlWarningLimit(int sqlWarningLimit) Set the maximum number of warnings regarding SQL errors that an operator can emit.final voidsetTableName(String tableName) Sets the name of the database table to access.voidSets the URL for connecting to the database, for example:jdbc:odbc:SampleTest.final voidSets the user name for connecting to the database.Methods inherited from class com.pervasive.datarush.operators.CompositeOperator
composeMethods inherited from class com.pervasive.datarush.operators.AbstractLogicalOperator
disableParallelism, getInputPorts, getOutputPorts, newInput, newInput, newOutput, newRecordInput, newRecordInput, newRecordOutput, notifyError
-
Method Details
-
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
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
Retrieves the password for connecting to the database.- Specified by:
getPasswordin interfaceConnectionSettings- Returns:
- the password for connecting to the database
-
setPassword
Sets the password for connecting to the database.- Parameters:
password- the password for connecting to the database
-
getUrl
Retrieves the URL for connecting to the database.- Specified by:
getUrlin interfaceConnectionSettings- Returns:
- the URL for connecting to the database
-
setUrl
Sets the URL for connecting to the database, for example:jdbc:odbc:SampleTest.- Parameters:
url- the URL for connecting to the database
-
getUser
Retrieves the user name for connecting to the database.- Specified by:
getUserin interfaceConnectionSettings- Returns:
- the user name for connecting to the database
-
setUser
Sets the user name for connecting to the database.- Parameters:
user- the user name for connecting to the database
-
getTableName
Retrieves the name of the database table to access.- Returns:
- the name of the database table to access
-
setTableName
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
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
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
Returns the connection factory to be used for creating connections. Defaults toDefaultConnectionFactory.- Returns:
- the connection factory to be used for creating connections.
-
setConnectionFactory
Sets the connection factory to be used for creating connections. Defaults toDefaultConnectionFactory.- Parameters:
connectionFactory- the connection factory to be used for creating connections.
-
getHostNames
Get the list of configured database host names.- Returns:
- database host names
-
setHostNames
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
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
-
setJDBCConnector
-