Class AbstractJDBCTestElement
- All Implemented Interfaces:
Serializable
,Cloneable
,Searchable
,TestElement
,TestStateListener
- Direct Known Subclasses:
AbstractJDBCProcessor
,JDBCSampler
- See Also:
-
Field Summary
FieldsFields inherited from interface org.apache.jmeter.testelement.TestElement
COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
close
(Connection c) static void
static void
protected byte[]
execute
(Connection conn) Execute the test element.int
getQuery()
void
setDataSource
(String dataSource) void
void
setQueryArguments
(String queryArguments) void
setQueryArgumentsTypes
(String queryArgumentsType) void
setQueryTimeout
(String queryTimeout) void
setQueryType
(String queryType) void
setResultSetHandler
(String resultSetHandler) void
setResultVariable
(String resultVariable) void
setVariableNames
(String variableNames) void
Called once for all threads after the end of a test.void
Called once for all threads after the end of a test.void
Called just before the start of the test from the main engine thread.void
testStarted
(String host) Called just before the start of the test from the main engine thread.toString()
Methods inherited from class org.apache.jmeter.testelement.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
- aSampleResult
in case the test should sample;null
if 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:
testStarted
in 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:
testStarted
in 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:
testEnded
in 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:
testEnded
in interfaceTestStateListener
- Parameters:
host
- name of host- See Also:
-