uk.org.skeet.jbench.tasks
Class PreparedStatementTask

java.lang.Object
  |
  +--uk.org.skeet.jbench.tasks.SimpleTask
        |
        +--uk.org.skeet.jbench.tasks.PreparedStatementTask
All Implemented Interfaces:
BenchTask

public class PreparedStatementTask
extends SimpleTask

Class to create a large number of similar or the same PreparedStatements on a single connection - this tests whether or not the driver itself caches the parsed statements.


Constructor Summary
PreparedStatementTask()
           
 
Method Summary
 void checkConfiguration()
          Checks that we have a positive size
 void checkResults()
          Closes the connection.
 java.lang.String getDescription()
          Default description which gives the name of the actual class and the number of iterations.
 void prepareTest()
          Simple no-op implementation of prepareTest.
 void runTest()
          Runs a test.
 void setDriver(java.lang.String driver)
          Sets the driver
 void setJustTestString(boolean justTestString)
          Sets the justTestString
 void setSame(boolean same)
          Sets the same parameter
 void setUrl(java.lang.String url)
          Sets the url
 
Methods inherited from class uk.org.skeet.jbench.tasks.SimpleTask
getSize, setSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PreparedStatementTask

public PreparedStatementTask()
Method Detail

runTest

public void runTest()
             throws TaskException
Description copied from interface: BenchTask
Runs a test. This is the method which is timed for result purposes. This should not include any preparation or result checking unless the time reported deliberately requires it.
See Also:
BenchTask.runTest()

prepareTest

public void prepareTest()
                 throws TaskException
Description copied from class: SimpleTask
Simple no-op implementation of prepareTest.
Overrides:
prepareTest in class SimpleTask
See Also:
SimpleTask.prepareTest()

checkConfiguration

public void checkConfiguration()
                        throws ConfigurationException
Description copied from class: SimpleTask
Checks that we have a positive size
Overrides:
checkConfiguration in class SimpleTask
See Also:
SimpleTask.checkConfiguration()

setUrl

public void setUrl(java.lang.String url)
Sets the url
Parameters:
url - The url to set

setSame

public void setSame(boolean same)
Sets the same parameter
Parameters:
same - The same to set

setDriver

public void setDriver(java.lang.String driver)
Sets the driver
Parameters:
driver - The driver to set

checkResults

public void checkResults()
                  throws TaskException
Closes the connection.
Overrides:
checkResults in class SimpleTask
See Also:
SimpleTask.checkResults()

setJustTestString

public void setJustTestString(boolean justTestString)
Sets the justTestString
Parameters:
justTestString - The justTestString to set

getDescription

public java.lang.String getDescription()
Description copied from class: SimpleTask
Default description which gives the name of the actual class and the number of iterations.
Overrides:
getDescription in class SimpleTask
See Also:
SimpleTask.getDescription()