org.apache.jmeter.protocol.jdbc.config

## Class DataSourceElement

- java.lang.Object
- - org.apache.jmeter.testelement.AbstractTestElement
  - - org.apache.jmeter.protocol.jdbc.config.DataSourceElement

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, ConfigElement, Searchable, TestBean, TestElement, TestStateListener

      public class DataSourceElement
      extends AbstractTestElement
      implements ConfigElement, TestStateListener, TestBean

  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from interface org.apache.jmeter.testelement.TestElement

      `COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DataSourceElement()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addConfigElement(ConfigElement config)` Add a configuration element to this one.
    `java.lang.Object` | `clone()`
    `boolean` | `expectsModification()` If 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.
    `java.lang.String` | `getCheckQuery()`
    `static java.sql.Connection` | `getConnection(java.lang.String poolName)` Utility routine to get the connection from the pool.
    `java.lang.String` | `getConnectionAge()`
    `static java.lang.String` | `getConnectionInfo(java.lang.String poolName)` Gets a textual description about the pools configuration.
    `java.lang.String` | `getDataSource()`
    `java.lang.String` | `getDbUrl()`
    `java.lang.String` | `getDriver()`
    `java.lang.String` | `getPassword()`
    `java.lang.String` | `getPoolMax()`
    `java.lang.String` | `getTimeout()`
    `java.lang.String` | `getTransactionIsolation()`
    `java.lang.String` | `getTrimInterval()`
    `java.lang.String` | `getUsername()`
    `boolean` | `isAutocommit()`
    `boolean` | `isKeepAlive()`
    `void` | `setAutocommit(boolean autocommit)`
    `void` | `setCheckQuery(java.lang.String checkQuery)`
    `void` | `setConnectionAge(java.lang.String connectionAge)`
    `void` | `setDataSource(java.lang.String dataSource)`
    `void` | `setDbUrl(java.lang.String dbUrl)`
    `void` | `setDriver(java.lang.String driver)`
    `void` | `setKeepAlive(boolean keepAlive)`
    `void` | `setPassword(java.lang.String password)`
    `void` | `setPoolMax(java.lang.String poolMax)`
    `void` | `setTimeout(java.lang.String timeout)`
    `void` | `setTransactionIsolation(java.lang.String transactionIsolation)`
    `void` | `setTrimInterval(java.lang.String trimInterval)`
    `void` | `setUsername(java.lang.String username)`
    `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.

    - ### Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement

      `addPropertiesValues, addProperty, addProperty, addTestElement, canRemove, clear, clearTemporary, clearTestElementChildren, 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`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.jmeter.testelement.TestElement

      `removed`

- - ### Constructor Detail

    - #### DataSourceElement

          public DataSourceElement()

  - ### Method Detail

    - #### testEnded

          public void testEnded()

      Description copied from interface: `TestStateListener`

      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 interface `TestStateListener`
      See Also:
        `StandardJMeterEngine.stopTest()`

    - #### testEnded

          public void testEnded(java.lang.String host)

      Description copied from interface: `TestStateListener`

      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 interface `TestStateListener`
      Parameters:
        `host` - name of host
      See Also:
        `StandardJMeterEngine.stopTest()`

    - #### testStarted

          public void testStarted()

      Description copied from interface: `TestStateListener`

      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 interface `TestStateListener`
      See Also:
        `StandardJMeterEngine.run()`

    - #### testStarted

          public void testStarted(java.lang.String host)

      Description copied from interface: `TestStateListener`

      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 interface `TestStateListener`
      Parameters:
        `host` - name of host
      See Also:
        `StandardJMeterEngine.run()`

    - #### clone

          public java.lang.Object clone()

      Specified by:
        `clone` in interface `ConfigElement`
      Specified by:
        `clone` in interface `TestElement`
      Overrides:
        `clone` in class `AbstractTestElement`

    - #### getConnectionInfo

          public static java.lang.String getConnectionInfo(java.lang.String poolName)
                                                    throws java.sql.SQLException

      Gets a textual description about the pools configuration.
      Parameters:
        `poolName` - Pool name
      Returns:
        Connection information on `poolName` or a short message, when the JMeter object specified by `poolName` is not a pool
      Throws:
        `java.sql.SQLException` - when an error occurs, while gathering information about the connection

    - #### getConnection

          public static java.sql.Connection getConnection(java.lang.String poolName)
                                                   throws java.sql.SQLException

      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 necessary
      Parameters:
        `poolName` - name of the pool to get a connection from
      Returns:
        a possible cached connection from the pool
      Throws:
        `java.sql.SQLException` - when an error occurs while getting the connection from the pool

    - #### addConfigElement

          public void addConfigElement(ConfigElement config)

      Description copied from interface: `ConfigElement`
      Add 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:
        `addConfigElement` in interface `ConfigElement`
      Parameters:
        `config` - the element to be added to this ConfigElement

    - #### expectsModification

          public boolean expectsModification()

      Description copied from interface: `ConfigElement`
      If 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:
        `expectsModification` in interface `ConfigElement`
      Returns:
        true if the element expects to be modified over the course of a test run

    - #### getCheckQuery

          public java.lang.String getCheckQuery()

      Returns:
        Returns the checkQuery.

    - #### setCheckQuery

          public void setCheckQuery(java.lang.String checkQuery)

      Parameters:
        `checkQuery` - The checkQuery to set.

    - #### getConnectionAge

          public java.lang.String getConnectionAge()

      Returns:
        Returns the connectionAge.

    - #### setConnectionAge

          public void setConnectionAge(java.lang.String connectionAge)

      Parameters:
        `connectionAge` - The connectionAge to set.

    - #### getDataSource

          public java.lang.String getDataSource()

      Returns:
        Returns the poolname.

    - #### setDataSource

          public void setDataSource(java.lang.String dataSource)

      Parameters:
        `dataSource` - The poolname to set.

    - #### getDbUrl

          public java.lang.String getDbUrl()

      Returns:
        Returns the dbUrl.

    - #### setDbUrl

          public void setDbUrl(java.lang.String dbUrl)

      Parameters:
        `dbUrl` - The dbUrl to set.

    - #### getDriver

          public java.lang.String getDriver()

      Returns:
        Returns the driver.

    - #### setDriver

          public void setDriver(java.lang.String driver)

      Parameters:
        `driver` - The driver to set.

    - #### getPassword

          public java.lang.String getPassword()

      Returns:
        Returns the password.

    - #### setPassword

          public void setPassword(java.lang.String password)

      Parameters:
        `password` - The password to set.

    - #### getPoolMax

          public java.lang.String getPoolMax()

      Returns:
        Returns the poolMax.

    - #### setPoolMax

          public void setPoolMax(java.lang.String poolMax)

      Parameters:
        `poolMax` - The poolMax to set.

    - #### getTimeout

          public java.lang.String getTimeout()

      Returns:
        Returns the timeout.

    - #### setTimeout

          public void setTimeout(java.lang.String timeout)

      Parameters:
        `timeout` - The timeout to set.

    - #### getTrimInterval

          public java.lang.String getTrimInterval()

      Returns:
        Returns the trimInterval.

    - #### setTrimInterval

          public void setTrimInterval(java.lang.String trimInterval)

      Parameters:
        `trimInterval` - The trimInterval to set.

    - #### getUsername

          public java.lang.String getUsername()

      Returns:
        Returns the username.

    - #### setUsername

          public void setUsername(java.lang.String username)

      Parameters:
        `username` - The username to set.

    - #### isAutocommit

          public boolean isAutocommit()

      Returns:
        Returns the autocommit.

    - #### setAutocommit

          public void setAutocommit(boolean autocommit)

      Parameters:
        `autocommit` - The autocommit to set.

    - #### isKeepAlive

          public boolean isKeepAlive()

      Returns:
        Returns the keepAlive.

    - #### setKeepAlive

          public void setKeepAlive(boolean keepAlive)

      Parameters:
        `keepAlive` - The keepAlive to set.

    - #### getTransactionIsolation

          public java.lang.String getTransactionIsolation()

      Returns:
        the transaction isolation level

    - #### setTransactionIsolation

          public void setTransactionIsolation(java.lang.String transactionIsolation)

      Parameters:
        `transactionIsolation` - The transaction isolation level to set. `NULL` to use the default of the driver.

Copyright © 1998-2018 Apache Software Foundation. All Rights Reserved.