Как подключить через soapui к бд
Перейти к содержимому

Как подключить через soapui к бд

How to create a MSSQL server connection in SOAPUI

I am new to SOAPUI. On internet i found, this can be done with two ways: Either i can use SoapUI JDBC wizard or Using groovy script. First i tried to create connection using Wizard but i am getting this error :

com.eviware.soapui.support.SoapUIException: Failed to init connection for driver [com.microsoft.jdbc.sqlserver.SQLServerDriver], connectionString [jdbc:microsoft:sqlserver://192.168.185.100\MyDB;databaseName=ABC?user=Test&password=Pass]

enter image description here enter image description here

I extract the JDBC driver to path

C:\Program Files\Microsoft JDBC Driver 4.0 for SQL Server

and Copy this Jar file

C:\Program Files\Microsoft JDBC Driver 4.0 for SQL Server\sqljdbc_4.0\enu\sqljdbc4.jar

Added Environment Variable

variable name : classpath

variable value : C:\Program Files\Microsoft JDBC Driver 4.0 for SQL Server\sqljdbc_4.0\enu\sqljdbc4.jar;

SoapUI — JDBC Connection

SoapUI allows managing database operation using a TestStep called JDBC Request.

Step 1 − Right-click on TestStep and select Add Step → JDBC Request.

JDBC Request

Step 2 − Enter the step name and click OK.

New Step

JDBC Step is added. Double-click step, and the JDBC wizard will open.

JDBC Wizard

To create a JDBC connection, the user needs to provide valid Driver and Connection String. These parameters are used to identify the type of database and create a connection to use the database.

For MySQL, database driver can be com.mysql.jdbc.Driver. Similarly, for other database, there is a predefined driver that can be found by the document section of the database.

Step 3 − Connection String should be in the following format −

Here, property is the username and password along with other parameters required to connect with a database.

Step 4 − Click Test Connection. On successful connection, it will display SUCCESS otherwise provide the details of failure.

SoapUI – соединение JDBC

SoapUI позволяет управлять работой базы данных с помощью TestStep, который называется JDBC Request.

Шаг 1 – Щелкните правой кнопкой мыши TestStep и выберите Добавить шаг → Запрос JDBC.

Запрос JDBC

Шаг 2 – введите имя шага и нажмите ОК.

Новый Шаг

Шаг JDBC добавлен. Дважды щелкните шаг, и откроется мастер JDBC.

Мастер JDBC

Чтобы создать соединение JDBC, пользователь должен предоставить действительный драйвер и строку подключения. Эти параметры используются для определения типа базы данных и создания соединения для использования базы данных.

Для MySQL драйвером базы данных может быть com.mysql.jdbc.Driver . Аналогично, для другой базы данных есть предопределенный драйвер, который можно найти в разделе документов базы данных.

Шаг 3 – Строка подключения должна быть в следующем формате –

Здесь свойство – это имя пользователя и пароль, а также другие параметры, необходимые для соединения с базой данных.

Шаг 4 – Нажмите «Проверить соединение». При успешном подключении будет отображаться УСПЕХ, в противном случае предоставьте подробности отказа.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *