JMeter (eight)-JDBC request (SQL Server)

Source: Internet
Author: User
Tags sql server driver mssql postgresql access database

To do a JDBC request, first understand what this JDBC object is, and then look for the database connection URL and database driver for the response.

Database Url:jdbc:sqlserver://200.99.197.190:1433;databasename=ebank

Database driver: Com.microsoft.sqlserver.jdbc.SQLServerDriver

Download Sqljdbc4.jar under Apache-jmeter-2.6\lib

SQL Server driver package (JAR) Name:

Microsoft+sql+server+jdbc+driver+3.0sqljdbc_3.0.1301.101_chs.exe

--Download and unzip put the Sqljdbc4.jar under the Apache-jmeter-2.6\lib

I use a connection database to specify the driver class, but also some people use the Jtds open source community driver class, different driver classes corresponding to the jar is different, be sure to pay attention to.

Connecting the database specifies the driver class (you can download the standard version of SQL Server driver)

ClassName = "Com.microsoft.jdbc.sqlserver.SQLServerDriver";

Access database URL = "JDBC:MICROSOFT:SQLSERVER://LOCALHOST:1433;DATABASENAME=DB_JXC; Selectmethod=cursor ";

Jtds Open Source Community driver class (do not know where to download, 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/[email Protected]//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 database driver class and URL format are collected in the table above

Add JDBC Default connection request, that is, MS SQL connection information: Database URL ( different driver classes have different connection strings ), MSSQL driver class, database user name password.

Add a JDBC request, here is the stored procedure statement I executed. The statements are parameterized

Parameterization is done with the JMeter control, without the function helper.

The assertion is also used in this script because there is a SQL return value in the JDBC request (stored procedure), and if it returns to 1, the stored procedure executes successfully

JMeter (eight)-JDBC request (SQL Server)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.