Learn how to use the JSR223 sampler to store SQL query results into a database table
P粉6333098012023-08-29 22:13:53
0
1
414
Please provide step-by-step process
How to use jsr223 sampler to connect to MySQL database and execute queries, and store the results in the database table? Please provide sample code for this theme
DownloadMySQL JDBC Driverand put it into the "lib" folder under the JMeter installation directory (or put it into other files in theJMeter classpathfolder)
DownloadMySQL JDBC Driverand put it into the "lib" folder under the JMeter installation directory (or put it into other files in theJMeter classpathfolder)
Restart JMeter to load the .jar file
AddThread Groupto your test plan
AddJSR223 Samplerto your thread group
Put the following code into the "Script" area:
Change
your-database-host
,your-database-port
, etc. to the real IP address, port, credentials, table name, column name, etc.Enjoy it
More information:
Side note: I believe it would be faster and easier to use theJDBC Requestssampler