- 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 forReadFromJDBC
andAbstractWriteToJDBC
. Exposes configuration properties common to both;
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConnectionFactory
getConnectionFactory()
Returns the connection factory to be used for creating connections.String
getDriverName()
Retrieves the class name of the JDBC driver to use.ErrorAction
getErrorAction()
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 JDBCConnector
getJDBCConnector()
String
getPassword()
Retrieves the password for connecting to the database.int
getSqlWarningLimit()
Retrieves the maximum number of warnings regarding SQL errors that an operator can emit.String
getTableName()
Retrieves the name of the database table to access.String
getUrl()
Retrieves the URL for connecting to the database.String
getUser()
Retrieves the user name for connecting to the database.void
setConnectionFactory(ConnectionFactory connectionFactory)
Sets the connection factory to be used for creating connections.void
setDriverName(String driverName)
Sets the class name of the JDBC driver to use, for example:"sun.jdbc.odbc.JdbcOdbcDriver"
.void
setErrorAction(ErrorAction errorAction)
Sets the action to take if a SQL error occurs while reading data from the database.void
setHostNames(String... hostNames)
Set the list of database host names that can be used to execute queries.void
setHostNames(List<String> hostNames)
Set the list of database host names that can be used to execute queries.protected void
setJDBCConnector(JDBCConnector jdbcConnector)
void
setPassword(String password)
Sets the password for connecting to the database.void
setSqlWarningLimit(int sqlWarningLimit)
Set the maximum number of warnings regarding SQL errors that an operator can emit.void
setTableName(String tableName)
Sets the name of the database table to access.void
setUrl(String url)
Sets the URL for connecting to the database, for example:jdbc:odbc:SampleTest
.void
setUser(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:
getDriverName
in 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:
getPassword
in 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:
getUrl
in 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:
getUser
in 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#errorAction
isErrorAction.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)
-
-