public abstract class AbstractJDBCTestElement extends AbstractTestElement implements TestStateListener
Modifier and Type | Field and Description |
---|---|
protected static java.lang.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(java.sql.Connection c) |
static void |
close(java.sql.ResultSet rs) |
static void |
close(java.sql.Statement s) |
protected byte[] |
execute(java.sql.Connection conn)
Execute the test element.
|
protected byte[] |
execute(java.sql.Connection conn,
SampleResult sample)
Execute the test element.
|
java.lang.String |
getDataSource() |
int |
getIntegerQueryTimeout() |
java.lang.String |
getQuery() |
java.lang.String |
getQueryArguments() |
java.lang.String |
getQueryArgumentsTypes() |
java.lang.String |
getQueryTimeout() |
java.lang.String |
getQueryType() |
java.lang.String |
getResultSetHandler() |
java.lang.String |
getResultVariable() |
java.lang.String |
getVariableNames() |
void |
setDataSource(java.lang.String dataSource) |
void |
setQuery(java.lang.String query) |
void |
setQueryArguments(java.lang.String queryArguments) |
void |
setQueryArgumentsTypes(java.lang.String queryArgumentsType) |
void |
setQueryTimeout(java.lang.String queryTimeout) |
void |
setQueryType(java.lang.String queryType) |
void |
setResultSetHandler(java.lang.String resultSetHandler) |
void |
setResultVariable(java.lang.String resultVariable) |
void |
setVariableNames(java.lang.String variableNames) |
void |
testEnded()
Called once for all threads after the end of a test.
|
void |
testEnded(java.lang.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(java.lang.String host)
Called just before the start of the test from the main engine thread.
|
java.lang.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 AbstractJDBCTestElement()
protected byte[] execute(java.sql.Connection conn) throws java.sql.SQLException, java.io.IOException, java.lang.UnsupportedOperationException
conn
- a Connection
java.sql.SQLException
- if a database error occursjava.io.IOException
- when I/O error occursjava.lang.UnsupportedOperationException
- if the user provided incorrect query typeprotected byte[] execute(java.sql.Connection conn, SampleResult sample) throws java.sql.SQLException, java.io.IOException, java.lang.UnsupportedOperationException
conn
- a Connection
sample
- a SampleResult
to save the latencyjava.sql.SQLException
- if a database error occursjava.io.IOException
- when I/O error occursjava.lang.UnsupportedOperationException
- if the user provided incorrect query typepublic static void close(java.sql.Connection c)
public static void close(java.sql.Statement s)
public static void close(java.sql.ResultSet rs)
public int getIntegerQueryTimeout()
public java.lang.String getQueryTimeout()
public void setQueryTimeout(java.lang.String queryTimeout)
queryTimeout
- query timeout in secondspublic java.lang.String getQuery()
public java.lang.String toString()
toString
in class java.lang.Object
public void setQuery(java.lang.String query)
query
- The query to set.public java.lang.String getDataSource()
public void setDataSource(java.lang.String dataSource)
dataSource
- The dataSource to set.public java.lang.String getQueryType()
public void setQueryType(java.lang.String queryType)
queryType
- The queryType to set.public java.lang.String getQueryArguments()
public void setQueryArguments(java.lang.String queryArguments)
public java.lang.String getQueryArgumentsTypes()
public void setQueryArgumentsTypes(java.lang.String queryArgumentsType)
public java.lang.String getVariableNames()
public void setVariableNames(java.lang.String variableNames)
variableNames
- the variableNames to setpublic java.lang.String getResultSetHandler()
public void setResultSetHandler(java.lang.String resultSetHandler)
resultSetHandler
- the resultSetHandler to setpublic java.lang.String getResultVariable()
public void setResultVariable(java.lang.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(java.lang.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(java.lang.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.