Package org.apache.jmeter.protocol.jdbc
Class AbstractJDBCTestElement
java.lang.Object
org.apache.jmeter.testelement.AbstractTestElement
org.apache.jmeter.protocol.jdbc.AbstractJDBCTestElement
- All Implemented Interfaces:
Serializable,Cloneable,Searchable,org.apache.jmeter.testelement.TestElement
- Direct Known Subclasses:
AbstractJDBCProcessor,JDBCSampler
A base class for all JDBC test elements handling the basics of a SQL request.
- 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) 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
-