public class RDBMSStreamProcessorUtil extends Object
| Constructor and Description |
|---|
RDBMSStreamProcessorUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
cleanupConnection(ResultSet rs,
Statement stmt,
Connection conn)
Method which can be used to clear up and ephemeral SQL connectivity artifacts.
|
static com.zaxxer.hikari.HikariDataSource |
getDataSourceService(String dataSourceName)
Utility class to get the datasource service
|
static void |
populateStatementWithSingleElement(PreparedStatement stmt,
int ordinal,
org.wso2.siddhi.query.api.definition.Attribute.Type type,
Object value)
Util method which is used to populate a
PreparedStatement instance with a single element. |
static Object[] |
processRecord(List<org.wso2.siddhi.query.api.definition.Attribute> attributeList,
ResultSet rs)
Convert a record in result set to object array.
|
static boolean |
queryContainsCheck(boolean isRetrievalQuery,
String query)
Utility function for validating the query.
|
static String |
validateDatasourceName(org.wso2.siddhi.core.executor.ExpressionExecutor attributeExpressionExecutor)
The datasource parameter is validated
|
public static void cleanupConnection(ResultSet rs, Statement stmt, Connection conn)
rs - ResultSet instance (can be null)stmt - Statement instance (can be null)conn - Connection instance (can be null)public static Object[] processRecord(List<org.wso2.siddhi.query.api.definition.Attribute> attributeList, ResultSet rs) throws SQLException
attributeList - List of attributesrs - Result setSQLException - this is thrown when an error occurs when accessing the result set.public static boolean queryContainsCheck(boolean isRetrievalQuery,
String query)
isRetrievalQuery - Is it a retrieval queryquery - Query that is to be validatedpublic static String validateDatasourceName(org.wso2.siddhi.core.executor.ExpressionExecutor attributeExpressionExecutor)
attributeExpressionExecutor - Function parameter Attribute Expression Executorpublic static com.zaxxer.hikari.HikariDataSource getDataSourceService(String dataSourceName)
dataSourceName - The datasource namepublic static void populateStatementWithSingleElement(PreparedStatement stmt, int ordinal, org.wso2.siddhi.query.api.definition.Attribute.Type type, Object value) throws SQLException
PreparedStatement instance with a single element.stmt - the statement to which the element should be set.ordinal - the ordinal of the element in the statement (its place in a potential list of places).type - the type of the element to be set, adheres to
Attribute.Type.value - the value of the element.SQLException - if there are issues when the element is being set.Copyright © 2018 WSO2. All rights reserved.