Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.

...

Connect custom DB Version 10 (Java)

Группа действий: Базы данных 

Описание

Действие выполняет подключение к базе данных с заданными параметрами подключения.

Иконка действия

Image Removed

Параметры

Входные параметры

  1. Уровень изоляции транзакций - Уровень изоляции доступа к базе во время выполнения транзакций.

  2. Логин Логин для подключения БД.

  3. Пароль – Пароль для подключения БД.

  4. URL сервера, где размещена БД– URL сервера, на котором развёрнута СУБД.

  5. Класс драйвера для указанной базы данных – Определённое полное имя класса драйвера для указанной базы данных.

  6. Путь к классу драйвера для указанной базы данных- Путь к драйверу для указанной базы данных.

  7. Тайм-аут - Предельное время ожидания подключения к БД.

Выходные параметры 

В результате получаем контекст подключения для работы с БД.

...

Action group: DB General 

...

Description

The action connects to database with set connection parameters. 

Action icon

Image Added

Parameters

Input parameters 

  1. Transaction isolation level - isolation level of access to the database during the execution of transactions.

  2. Login login to connect to database.

  3. Password – password to connect the database.

  4. DB server URL – the URL of the server where the database is located.

  5. Driver class full name – driver class full name for the set database. 

  6. The driver classpath for the specified database - the driver classpath for the specified database.

  7. Timeout - Time limit for connection creation to database.

Output parameters 

As a result, we get connection context to the selected database. 

Settings

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
Transaction isolation levelIsolation level of access to the database during the execution of transactions. Dropdown list: No transactions, Read
uncommited
uncommiеted, Read committed, Repeatable read, SerializableRobin.String
No
LoginLogin to connect the databaseRobin.String
No
PasswordPassword to connect the databaseRobin.Object
No
DB server URLThe URL of the server where the database is located. Examples: jdbc: h2: mem: h2inmem; jdbc: sqlite: C: Users User1 test.dbRobin.String
Yes
Driver class full nameDriver class full nameRobin.String
Yes
The driver classpath for the specified databaseThe driver classpath for the specified databaseRobin.FilePath
Yes
TimeoutTime limit for connection creation. Further it is used as the maximum waiting time for the execution of requests in the connection. The default is 60 s. May depend on driver implementation.Robin.Numeric
No
Results
DB contextConnection context to the selected databaseRobin.DbContextDatabase context

Особые условия использования


Special conditions of use 

The difference between a custom connection and a standard connection is that with the standard connection you can connect to only one of four available databases Разница между пользовательским подключением стандартным подключением заключается в том, что с помощью стандартного подключения можно подключиться только к 1 из 4-х доступных БД (Oracle, MySql, PostgreSql,MsSqlServer) , с помощью пользовательского подключения можно подключиться к любой БД для которой установлен jdbc-драйвер. 

Пример использования 

Задача 

, with the custom connection you can connect to any database for which the jdbc-driver is installed. 

Example of use  

Task 

Connect to database and execute statement. Подключиться к базе данных  и выполнить запрос 

SELECT * FROM Table1
ORDER BY id ASC;

...

Solution

Воспользоваться действиями "Пользовательское подключениеUse the "Connect custom Db", " Выполнить запросExecute Sql Statement" actions

Реализация

  1. Assemble a robot scheme with the actions: Собрать схему робота, состоящего из действий:
    Настроить параметры для действия "Пользовательское подключение".
    Уровень изоляции транзакций - уровень разрешения чтения данных для субъекта, который подключается к БД (пользователь или система). Возможны несколько уровней изоляции транзакций: 
    1. Без транзакций
    2. Чтение незаконченных транзакций разрешено
    3. Чтение только законченных транзакций
    4. Повторное чтение данных вернет те же значения, что и в начале транзакции
    5. Сериализуемость
    Чтение незаконченных транзакций разрешено - будет разрешено читать данные, которые модифицируются какой-либо другой транзакцией.
    Чтение только законченных транзакций - роботу можно будет читать только зафиксированные записи.
    Повторное чтение данных вернет те же значения, что и в начале транзакции - роботу можно будет читать только зафиксированные записи. Данные, которые робот читает в данный момент, другой субъект не сможет изменить, пока не закончится транзакция робота. 
    Сериализуемость - роботу можно будет читать только зафиксированные записи. Данные, которые робот читает в данный момент, другой субъект не сможет изменить и/или прочитать, пока не закончится транзакция робота. 
    Указать логин и пароль от БД. 
    В поле "URL сервера, где размещена БД" указать URL подключения к требуемой БД. Все дополнительные параметры необходимо указывать в URL сервера. 
    При использовании пользовательского подключения обязательно должен быть скачан драйвер для БД. Файл драйвера должен находится на той же машине, где работает программный робот. С помощью этого драйвера робот будет подключаться к базе. 
    В поле "Класс драйвера для указанной базы данных" необходимо указать имя класса драйвера. Узнать его можно в интернете, т.е посмотреть название драйвера под используемую БД. Соответственно, для каждого вида СУБД название класса драйвера будет свое. 
    В поле "Путь к классу драйвера для указанной базы данных" указать путь до файла драйвера, с помощью которого будет происходить подключение. Например: 
    Image Removed
    Значение в поле "Таймаут" измеряется в секундах. 
    Image Removed
  2. Настроить параметры для действия "Выполнить запрос". 
    Image Removed
  3. Нажать на кнопку "Старт" в верхней панели. 

Результат

  1. Set the "Connect Custom Db" action parameters. 
    Transaction isolation level - isolation level of access to the database during the execution of transactions. Dropdown list: 
    1. no transactions 
    2. read uncommitted 
    3. read committed 
    4. repeatable read 
    5. serializable
    read uncommitted allowed - it will be allowed to read data that is modified by some other transaction.
    read committed - the robot will only be allowed to read the recorded entries.
    repeatable read - the robot will only be allowed to read the recorded entries. The data that the robot is currently reading cannot be changed by another entity until the robot's transaction is complete. 
    serializable - the robot will only be allowed to read the recorded entries. The data that the robot is currently reading cannot be changed and/or read by another entity until the robot's transaction is complete. 

  2. Specify the database login and password. 
    In the "DB server URL" specify the URL of connection to the required database. All additional parameters must be specified in the server URL. 
    When using a custom connection, the driver for the database must be downloaded. The driver file must be located on the same machine where the program robot is running. This driver will be used to connect the robot to the database. 
    In “The driver classpath for the specified database” field set the name of the driver class. You can find it on the Internet, i.e. look up the driver name for the database you are using. Accordingly, for each type of database the driver class name will be different. 
    In “The driver classpath for the specified database” field, specify the path to the driver file that will be used to make the connection. For example:
    Image Added
    Value in the "Timeout" field is measured in seconds.
    Image Added

  3. Set the “ Execute statement” action parameters.      Image Added
  4. Click "Start" in the top panel. 

Result

The program robot completed successfully. The statement was executedПрограммный робот отработал успешно. Запрос выполнен