Class AbstractJDBCTestElement
- All Implemented Interfaces:
Serializable,Cloneable,Searchable,org.apache.jmeter.testelement.TestElement,TestStateListener
- Direct Known Subclasses:
AbstractJDBCProcessor,JDBCSampler
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.jmeter.testelement.TestElement
org.apache.jmeter.testelement.TestElement.Companion -
Field Summary
FieldsFields inherited from interface org.apache.jmeter.testelement.TestElement
COMMENTS, Companion, 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.protected byte[]execute(Connection conn, SampleResult sample) Execute the test element.intintgetQuery()voidsetDataSource(String dataSource) voidvoidsetQueryArguments(String queryArguments) voidsetQueryArgumentsTypes(String queryArgumentsType) voidsetQueryTimeout(String queryTimeout) voidsetQueryType(String queryType) voidsetResultSetHandler(String resultSetHandler) voidsetResultSetMaxRows(String resultSetMaxRows) 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 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, getPropertyOrNull, 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, traversePropertyMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.jmeter.testelement.TestElement
get, get, get, get, get, get, get, get, get, getOrCreate, getOrCreate, getOrNull, getOrNull, getOrNull, getPropertyOrNull, getProps, getSchema, getString, removed, removeProperty, set, set, set, set, set, set, set, set, set
-
Field Details
-
ENCODING
-
-
Constructor Details
-
AbstractJDBCTestElement
protected AbstractJDBCTestElement()Creates a JDBCSampler.
-
-
Method Details
-
execute
protected byte[] execute(Connection conn) throws SQLException, IOException, UnsupportedOperationException Execute the test element.- Parameters:
conn- aConnection- Returns:
- the result of the execute command
- Throws:
SQLException- if a database error occursIOException- when I/O error occursUnsupportedOperationException- if the user provided incorrect query type
-
execute
protected byte[] execute(Connection conn, SampleResult sample) throws SQLException, IOException, UnsupportedOperationException Execute the test element. Use the sample given as argument to set time to first byte in the "latency" field of the SampleResult.- Parameters:
conn- aConnectionsample- aSampleResultto save the latency- Returns:
- the result of the execute command
- Throws:
SQLException- if a database error occursIOException- 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
-
getIntegerResultSetMaxRows
public int getIntegerResultSetMaxRows()- Returns:
- the integer representation resultSetMaxRows
-
getResultSetMaxRows
- Returns:
- the resultSetMaxRows
-
setResultSetMaxRows
- Parameters:
resultSetMaxRows- max number of rows to iterate through the ResultSet
-
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:
-