To make a JDBC request, first understand what the JDBC object is, and then look for the response database connection URL and database driver.
Database URL: jdbc: sqlserver: // 200.99.197.190: 1433; databaseName = ebank
Database DRIVER: com. microsoft. sqlserver. jdbc. SQLServerDriver
Download sqljdbc4.jar and place it under apache-jmeter-2.6 \ lib
Sqlserver driver package (jar) Name:
Microsoft‑sql‑server‑jdbc‑driver=3.0sqljdbc_3.0.1301.101_chs.exe
-- Download and decompress the sqljdbc4.jar in the apache-jmeter-2.6 \ lib under
The method I use is to specify the driver class by connecting to the database, and some people use the Driver Class in the JTDS open-source community,Corresponding to different driver classesJarDifferent.
Connect to the specified Driver Class of the database (you can download the standard sqlserver driver)
ClassName = "com. microsoft. jdbc. sqlserver. SQLServerDriver ";
Access Database Url = "jdbc: microsoft: sqlserver: // localhost: 1433; DatabaseName = db_JXC; SelectMethod = Cursor ";
Driver Class in the JTDS open-source community (I don't know where to download it, JTDS open-source community ?)
Class. forName (net. sourceforge. jtds. jdbc. Driver). newInstance ();
DriverManager. getConnection ("jdbc: jtds: sqlserver: // localhost: 1433/" + "library", "user", "password ");
Datebase |
Driver class |
Database URL |
MySQL |
Com. mysql. jdbc. Driver |
Jdbc: mysql: // host: port/{dbname} |
PostgreSQL |
Org. postgresql. Driver |
Jdbc: postgresql: {dbname} |
Oracle |
Oracle. jdbc. driver. OracleDriver |
Jdbc: oracle: thin: user/pass @ // host: port/service |
Ingres (2006) |
Ingres. jdbc. IngresDriver |
Jdbc: ingres: // host: port/db [; attr = value] |
MSSQL |
Com. microsoft. sqlserver. jdbc. SQLServerDriver Or Net. sourceforge. jtds. jdbc. Driver |
Jdbc: sqlserver: // IP: 1433; databaseName = DBname Or Jdbc: jtds: sqlserver: // localhost: 1433/"+" library" |
The above table lists the collected database driver classes and URL formats.
Add the JDBC default connection request, that is, the connection information of MS SQL: Database URL (Different driver classes have different connection strings.), MSSQL Driver Class, database username and password.
Add a JDBC request. Here is the Stored Procedure statement that I executed. Parameterization is used in the statement.
Parameterization is performed using the jmeter control, and no function assistant is used.
Assertions are also used in this script, because the JDBC request (Stored Procedure) has an SQL return value. If the return value is 1, the stored procedure is successfully executed.