Class AbstractJDBCTestElement
- All Implemented Interfaces:
Serializable, Cloneable, Searchable, TestElement, TestStateListener
- Direct Known Subclasses:
AbstractJDBCProcessor, JDBCSampler
- See Also:
-
Field Summary
FieldsFields inherited from interface TestElement
COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclose(Connection c) static voidstatic voidprotected byte[]execute(Connection conn) Execute the test element.intgetQuery()voidsetDataSource(String dataSource) voidvoidsetQueryArguments(String queryArguments) voidsetQueryArgumentsTypes(String queryArgumentsType) voidsetQueryTimeout(String queryTimeout) voidsetQueryType(String queryType) voidsetResultSetHandler(String resultSetHandler) voidsetResultVariable(String resultVariable) voidsetVariableNames(String variableNames) voidCalled once for all threads after the end of a test.voidCalled once for all threads after the end of a test.voidCalled just before the start of the test from the main engine thread.voidtestStarted(String host) Called just before the start of the test from the main engine thread.toString()Methods inherited from class AbstractTestElement
addPropertiesValues, addProperty, addProperty, addTestElement, canRemove, clear, clearTemporary, clearTestElementChildren, clone, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getSearchableTokens, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, logProperties, mergeIn, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse, traverseCollection, traverseMap, traverseProperty
-
Field Details
-
ENCODING
- See Also:
-
-
Constructor Details
-
AbstractJDBCTestElement
protected AbstractJDBCTestElement()Creates a JDBCSampler.
-
-
Method Details
-
execute
protected byte[] execute(Connection conn) throws SQLException, UnsupportedEncodingException, IOException, UnsupportedOperationException Execute the test element.- Parameters:
conn- aSampleResultin case the test should sample;nullif only execution is requested- Returns:
- the result of the execute command
- Throws:
SQLException- if a database error occursUnsupportedEncodingException- when the result can not be converted to the required charsetIOException- when I/O error occursUnsupportedOperationException- if the user provided incorrect query type
-
close
-
close
-
close
-
getIntegerQueryTimeout
public int getIntegerQueryTimeout()- Returns:
- the integer representation queryTimeout
-
getQueryTimeout
- Returns:
- the queryTimeout
-
setQueryTimeout
- Parameters:
queryTimeout- query timeout in seconds
-
getQuery
-
toString
-
setQuery
- Parameters:
query- The query to set.
-
getDataSource
- Returns:
- Returns the dataSource.
-
setDataSource
- Parameters:
dataSource- The dataSource to set.
-
getQueryType
- Returns:
- Returns the queryType.
-
setQueryType
- Parameters:
queryType- The queryType to set.
-
getQueryArguments
-
setQueryArguments
-
getQueryArgumentsTypes
-
setQueryArgumentsTypes
-
getVariableNames
- Returns:
- the variableNames
-
setVariableNames
- Parameters:
variableNames- the variableNames to set
-
getResultSetHandler
- Returns:
- the resultSetHandler
-
setResultSetHandler
- Parameters:
resultSetHandler- the resultSetHandler to set
-
getResultVariable
- Returns:
- the resultVariable
-
setResultVariable
- Parameters:
resultVariable- the variable name in which results will be stored
-
testStarted
public void testStarted()Called just before the start of the test from the main engine thread. This is before the test elements are cloned. Note that not all the test variables will have been set up at this point.
N.B. testStarted() and testEnded() are called from different threads.
- Specified by:
testStartedin interfaceTestStateListener- See Also:
-
testStarted
Called just before the start of the test from the main engine thread. This is before the test elements are cloned. Note that not all the test variables will have been set up at this point.
N.B. testStarted() and testEnded() are called from different threads.
- Specified by:
testStartedin interfaceTestStateListener- Parameters:
host- name of host- See Also:
-
testEnded
public void testEnded()Called once for all threads after the end of a test. This will use the same element instances as at the start of the test.
N.B. testStarted() and testEnded() are called from different threads.
- Specified by:
testEndedin interfaceTestStateListener- See Also:
-
testEnded
Called once for all threads after the end of a test. This will use the same element instances as at the start of the test.
N.B. testStarted() and testEnded() are called from different threads.
- Specified by:
testEndedin interfaceTestStateListener- Parameters:
host- name of host- See Also:
-