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
Fields inherited from interface org.apache.jmeter.testelement.TestElement
COMMENTS, Companion, ENABLED, GUI_CLASS, NAME, TEST_CLASS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
close
(Connection c) static void
static void
protected byte[]
execute
(Connection conn) Execute the test element.protected byte[]
execute
(Connection conn, SampleResult sample) Execute the test element.int
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
setResultSetMaxRows
(String resultSetMaxRows) 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, 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, traverseProperty
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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
- aConnection
sample
- aSampleResult
to 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:
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:
-