public abstract class AbstractJDBCTestElement extends AbstractTestElement implements TestStateListener
Modifier and Type | Field and Description |
---|---|
protected static String |
ENCODING |
COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS
Modifier | Constructor and Description |
---|---|
protected |
AbstractJDBCTestElement()
Creates a JDBCSampler.
|
Modifier and Type | Method and Description |
---|---|
static void |
close(Connection c) |
static void |
close(ResultSet rs) |
static void |
close(Statement s) |
protected byte[] |
execute(Connection conn)
Execute the test element.
|
protected byte[] |
execute(Connection conn,
SampleResult sample)
Execute the test element.
|
String |
getDataSource() |
int |
getIntegerQueryTimeout() |
int |
getIntegerResultSetMaxRows() |
String |
getQuery() |
String |
getQueryArguments() |
String |
getQueryArgumentsTypes() |
String |
getQueryTimeout() |
String |
getQueryType() |
String |
getResultSetHandler() |
String |
getResultSetMaxRows() |
String |
getResultVariable() |
String |
getVariableNames() |
void |
setDataSource(String dataSource) |
void |
setQuery(String query) |
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 |
testEnded()
Called once for all threads after the end of a test.
|
void |
testEnded(String host)
Called once for all threads after the end of a test.
|
void |
testStarted()
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.
|
String |
toString() |
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
finalize, getClass, notify, notifyAll, wait, wait, wait
removed
protected static final String ENCODING
protected AbstractJDBCTestElement()
protected byte[] execute(Connection conn) throws SQLException, IOException, UnsupportedOperationException
conn
- a Connection
SQLException
- if a database error occursIOException
- when I/O error occursUnsupportedOperationException
- if the user provided incorrect query typeprotected byte[] execute(Connection conn, SampleResult sample) throws SQLException, IOException, UnsupportedOperationException
conn
- a Connection
sample
- a SampleResult
to save the latencySQLException
- if a database error occursIOException
- when I/O error occursUnsupportedOperationException
- if the user provided incorrect query typepublic static void close(Connection c)
public static void close(Statement s)
public static void close(ResultSet rs)
public int getIntegerQueryTimeout()
public String getQueryTimeout()
public void setQueryTimeout(String queryTimeout)
queryTimeout
- query timeout in secondspublic int getIntegerResultSetMaxRows()
public String getResultSetMaxRows()
public void setResultSetMaxRows(String resultSetMaxRows)
resultSetMaxRows
- max number of rows to iterate through the ResultSetpublic String getQuery()
public void setQuery(String query)
query
- The query to set.public String getDataSource()
public void setDataSource(String dataSource)
dataSource
- The dataSource to set.public String getQueryType()
public void setQueryType(String queryType)
queryType
- The queryType to set.public String getQueryArguments()
public void setQueryArguments(String queryArguments)
public String getQueryArgumentsTypes()
public void setQueryArgumentsTypes(String queryArgumentsType)
public String getVariableNames()
public void setVariableNames(String variableNames)
variableNames
- the variableNames to setpublic String getResultSetHandler()
public void setResultSetHandler(String resultSetHandler)
resultSetHandler
- the resultSetHandler to setpublic String getResultVariable()
public void setResultVariable(String resultVariable)
resultVariable
- the variable name in which results will be storedpublic 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.
testStarted
in interface TestStateListener
TestStateListener.testStarted()
public void testStarted(String host)
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.
testStarted
in interface TestStateListener
host
- name of hostTestStateListener.testStarted(java.lang.String)
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.
testEnded
in interface TestStateListener
TestStateListener.testEnded()
public void testEnded(String host)
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.
testEnded
in interface TestStateListener
host
- name of hostTestStateListener.testEnded(java.lang.String)
Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.