Class DataSourceElement
- All Implemented Interfaces:
- Serializable,- Cloneable,- ConfigElement,- Searchable,- TestBean,- org.apache.jmeter.testelement.TestElement,- TestStateListener
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.apache.jmeter.testelement.TestElementorg.apache.jmeter.testelement.TestElement.Companion
- 
Field SummaryFields inherited from interface org.apache.jmeter.testelement.TestElementCOMMENTS, Companion, ENABLED, GUI_CLASS, NAME, TEST_CLASS
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddConfigElement(ConfigElement config) Add a configuration element to this one.clone()booleanIf your config element expects to be modified in the process of a test run, and you want those modifications to carry over from sample to sample (as in a cookie manager - you want to save all cookies that get set throughout the test), then return true for this method.static ConnectiongetConnection(String poolName) Utility routine to get the connection from the pool.
 Purpose: allows JDBCSampler to be entirely independent of the pooling classes allows the pool storage mechanism to be changed if necessarystatic StringgetConnectionInfo(String poolName) Gets a textual description about the pools configuration.getDbUrl()Return the max number of pooled prepared statements.booleanbooleanbooleanvoidsetAutocommit(boolean autocommit) voidsetCheckQuery(String checkQuery) voidsetConnectionAge(String connectionAge) voidsetConnectionProperties(String connectionProperties) voidsetDataSource(String dataSource) voidvoidvoidsetInitQuery(String initQuery) voidsetKeepAlive(boolean keepAlive) voidsetPassword(String password) voidsetPoolMax(String poolMax) voidsetPoolPreparedStatements(String poolPreparedStatements) Set the max number of pooled prepared statements.voidsetPreinit(boolean preinit) voidsetTimeout(String timeout) voidsetTransactionIsolation(String transactionIsolation) voidsetTrimInterval(String trimInterval) voidsetUsername(String username) 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.Methods inherited from class org.apache.jmeter.testelement.AbstractTestElementaddPropertiesValues, addProperty, addProperty, addTestElement, canRemove, clear, clearTemporary, clearTestElementChildren, 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.Objectfinalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.jmeter.testelement.TestElementget, 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
- 
Constructor Details- 
DataSourceElementpublic DataSourceElement()
 
- 
- 
Method Details- 
testEndedpublic void testEnded()Description copied from interface:TestStateListenerCalled 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 interface- TestStateListener
- See Also:
 
- 
testEndedDescription copied from interface:TestStateListenerCalled 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 interface- TestStateListener
- Parameters:
- host- name of host
- See Also:
 
- 
testStartedpublic void testStarted()Description copied from interface:TestStateListenerCalled 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 interface- TestStateListener
- See Also:
 
- 
testStartedDescription copied from interface:TestStateListenerCalled 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 interface- TestStateListener
- Parameters:
- host- name of host
- See Also:
 
- 
clone- Specified by:
- clonein interface- ConfigElement
- Specified by:
- clonein interface- org.apache.jmeter.testelement.TestElement
- Overrides:
- clonein class- AbstractTestElement
 
- 
getConnectionInfoGets a textual description about the pools configuration.- Parameters:
- poolName- Pool name
- Returns:
- Connection information on poolNameor a short message, when the JMeter object specified bypoolNameis not a pool
- Throws:
- SQLException- when an error occurs, while gathering information about the connection
 
- 
getConnectionUtility routine to get the connection from the pool.
 Purpose:- allows JDBCSampler to be entirely independent of the pooling classes
- allows the pool storage mechanism to be changed if necessary
 - Parameters:
- poolName- name of the pool to get a connection from
- Returns:
- a possible cached connection from the pool
- Throws:
- SQLException- when an error occurs while getting the connection from the pool
 
- 
addConfigElementDescription copied from interface:ConfigElementAdd a configuration element to this one. This allows config elements to combine and give a "layered" effect. For example, HTTPConfigElements have properties for domain, path, method, and parameters. If element A has everything filled in, but null for domain, and element B is added, which has only domain filled in, then after adding B to A, A will have the domain from B. If A already had a domain, then the correct behavior is for A to ignore the addition of element B.- Specified by:
- addConfigElementin interface- ConfigElement
- Parameters:
- config- the element to be added to this ConfigElement
 
- 
expectsModificationpublic boolean expectsModification()Description copied from interface:ConfigElementIf your config element expects to be modified in the process of a test run, and you want those modifications to carry over from sample to sample (as in a cookie manager - you want to save all cookies that get set throughout the test), then return true for this method. Your config element will not be cloned for each sample. If your config elements are more static in nature, return false. If in doubt, return false.- Specified by:
- expectsModificationin interface- ConfigElement
- Returns:
- true if the element expects to be modified over the course of a test run
 
- 
getCheckQuery- Returns:
- Returns the checkQuery.
 
- 
setCheckQuery- Parameters:
- checkQuery- The checkQuery to set.
 
- 
getConnectionAge- Returns:
- Returns the connectionAge.
 
- 
setConnectionAge- Parameters:
- connectionAge- The connectionAge to set.
 
- 
getDataSource- Returns:
- Returns the poolname.
 
- 
setDataSource- Parameters:
- dataSource- The poolname to set.
 
- 
getDbUrl- Returns:
- Returns the dbUrl.
 
- 
setDbUrl- Parameters:
- dbUrl- The dbUrl to set.
 
- 
getDriver- Returns:
- Returns the driver.
 
- 
setDriver- Parameters:
- driver- The driver to set.
 
- 
getPassword- Returns:
- Returns the password.
 
- 
setPassword- Parameters:
- password- The password to set.
 
- 
getPoolMax- Returns:
- Returns the poolMax.
 
- 
setPoolMax- Parameters:
- poolMax- The poolMax to set.
 
- 
getTimeout- Returns:
- Returns the timeout.
 
- 
setTimeout- Parameters:
- timeout- The timeout to set.
 
- 
getTrimInterval- Returns:
- Returns the trimInterval.
 
- 
setTrimInterval- Parameters:
- trimInterval- The trimInterval to set.
 
- 
getUsername- Returns:
- Returns the username.
 
- 
setUsername- Parameters:
- username- The username to set.
 
- 
isAutocommitpublic boolean isAutocommit()- Returns:
- Returns the autocommit.
 
- 
setAutocommitpublic void setAutocommit(boolean autocommit) - Parameters:
- autocommit- The autocommit to set.
 
- 
isPreinitpublic boolean isPreinit()- Returns:
- Returns the preinit.
 
- 
setPreinitpublic void setPreinit(boolean preinit) - Parameters:
- preinit- The preinit to set.
 
- 
isKeepAlivepublic boolean isKeepAlive()- Returns:
- Returns the keepAlive.
 
- 
setKeepAlivepublic void setKeepAlive(boolean keepAlive) - Parameters:
- keepAlive- The keepAlive to set.
 
- 
getTransactionIsolation- Returns:
- the transaction isolation level
 
- 
setTransactionIsolation- Parameters:
- transactionIsolation- The transaction isolation level to set.- NULLto use the default of the driver.
 
- 
getInitQuery- Returns:
- the initQuery
 
- 
setInitQuery- Parameters:
- initQuery- the initQuery to set
 
- 
getConnectionProperties- Returns:
- the connectionProperties
 
- 
setConnectionProperties- Parameters:
- connectionProperties- the connectionProperties to set
 
- 
getPoolPreparedStatementsReturn the max number of pooled prepared statements. "0" means no limit on prepared statements to pool and "-1" disables pooling.- Returns:
- the max number of pooled prepared statements
 
- 
setPoolPreparedStatementsSet the max number of pooled prepared statements. "0" means no limit on prepared statements to pool and "-1" disables pooling.- Parameters:
- poolPreparedStatements- max number of prepared statements
 
 
-