Skip to main content

Run JMeter Database Scripts in AIQ

Run JMeter Database Scripts in AIQ

JMETERLast DB TESTING:reviewed:
September We21, assume2026

Use this article when AIQ executes a JMeter plan that theincludes readerdatabase hasaccess. fairKeep knowledgecredentials onsecure howand validate database impact before running load.

When to runuse teststhis onguidance

Jmeter.
  • A ThisJMeter documenttest plan uses JDBC or database queries.
  • The test is intendedexecuted or scheduled through AIQ.
  • You need to explainvalidate howconnectivity, Jmeterdrivers, DB testing workscredentials, and provideresult handling.
  1. Confirm the readerdatabase withendpoint and account are approved for test use.
  2. Package the basicrequired knowledgeJDBC about the configuration needed in order to successfully configuredriver and run a Jmeter DB test. We will be using the same Jmeter Db script to run in AIQ.
     Steps to be followed are given below
     1) Executing the script in Jmeter
     Add Users
     To create a Thread group,
     Right-click Test Plan.
     Select Add > Threads (Users) > Thread Group.
    Thus, thread group gets added under the Test Plan node.
    Rename this Thread Group as JDBC Users.


     Adding JDBC Requests
     Now that we defined our users,verify it is time to define the tasks that they will be performing. In this section, specify the JDBC requests to perform.
     Right-click the JDBC Users element.
     Select Add > Config Element > JDBC Connection Configuration.
     Set up the following fields −

    •  Variable name bound to pool. This needs to identify the configuration uniquely. It is used by the JDBC Sampler to identify the configuration to be used. We have named it as DBPool.
     Database URL − jdbc:mysql://localhost:3306/utp. JDBC Driver class: com.mysql.jdbc.Driver. Username: utp. Password: password for utp.

    The other fields on the screen are left as defaults as shown below −


     Now add a JDBC Request which refersavailable to the JDBCJMeter Configurationruntime.

    Store poolcredentials definedthrough above.approved Selectsecret JDBChandling Usersrather element.
    than Clickhard-coding your right mouse button to get the Add menu
     Select Add > Sampler > JDBC Request.
     Select this new element to view its Control Panel.
     Edit the properties as shown below −
      Variable name bound to pool. This needs to uniquely identify the configuration. It is used by the JDBC Sampler to identify the configuration to be used. Named it as DBPool. Name − JDBC Transaction. Enter the Pool Name − DBPool (same asthem in the configurationtest element).plan. Query Type − Select statement. Enter the SQL Query String field.


       Create Listener 
       Now add the Listener element. This element is responsible for storing all of the results of your JDBC requests inRun a filesmall andsmoke presenting a visual model of the data

        Select the JDBC Users element Add a View Results Tree listener (Add > Listener > View Results Tree).


         Now save the above test plan as db_test.jmx. Execute this test plan using Run > Start option. Once the test is completed you can go ahead and verify the output by clicking on "View Results Tree" shown below.



         2) Run the Saved Jmeter scriptexecution in AIQ
        Webefore assumescaling thatconcurrency.

        Monitor thedatabase reader has knowledge on how to create scenarioload and runclean theup test indata AIQ
        after User creates a new scenario and selects a functional testexecution.

        Note:
        Database


         Navigates to Test case tab and selects Test type as "Jmeter" and attaches the Jmeter script which ran successfully in Jmeter



         User now saves the scenario and runs theload tests andcan navigatesaffect toshared Testenvironments. ControllerCoordinate screenwith anddatabase verifiesowners the output



         In the above scenario we arebefore running ahigh-volume simple functional test in AIQ. However if the user wants to run a Load test we will have to make some changes in the Jmeter script. The below screenshot highlights the changes that needs to be done to run the Load test in APCscenarios.



         need to check in the Thread Group the option Delay Thread Creation Until Needed. Once the changes is made we can go ahead and save the script.
         User creates a Load test scenario with 5 users and 100 executions



        User now saves the scenario and runs the tests and navigates to Test Controller screen and verifies the output




        Last updated: JuneSeptember 26,21, 20232026

        If you have any feedback on this topic, please contact us at documentation@appvance.ai.