Connect standard Db Version 11 (Java)
Action group: Databases
Description
Creates a connection context to the standard database
More details can be found here: Instructions on how to connect to Microsoft SQL Server from Robin Studio
Action icon
Settings of parameters
Property | Description | Type | Filling example | Mandatory field |
Parameters | ||||
DATABASE TYPE | DB type | Robin.String | Yes | |
Login | Login to connect the database | Robin.String | No | |
Password | Password to connect the database | Robin.Object | No | |
Server host | Server host | Robin.String | No | |
Server port | Server port | Robin.Numeric | No | |
DB name | DB name | Robin.String | No | |
Timeout | Time 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 | |
Transaction isolation level | Enable the mode of using transactions inside the connection | Robin.Boolean | true | No |
Parameters | Additional connection parameters in the form of a dictionary | Robin.Dictionary | No | |
Results | ||||
DB context | Connection context to the selected database | Robin.DbContext | Database context |
Special conditions of use
The difference between custom connection and standard connection is that with standard connection you can connect only to 1 of 4 available databases (Oracle, MySql, PostgreSql, MsSqlServer), with custom connection you can connect to any database for which jdbc-driver is installed.
Example of use
Task
Connect to MsSqlServer database and execute the query
SELECT * FROM Table1
ORDER BY id ASC;
Solution
Use the actions "Connect Standard Db", "Execute Sql Statement".
Implementation
- Assemble a robot scheme consisting of actions:
- Configure the settings for the "Connect Standard Db" action.
In the "DATABASE TYPE" field, select the appropriate database to which you want to connect.
Specify the database Login and Password.
The Server host can be specified either by IP of the host where the database is installed or by host name.
Specify the Server port, as well as the DB name.
In the "Timeout" field, the value is calculated in seconds.
In the "Parameters" field specify additional parameters for connection, usually these are parameters that relate to security. Parameters are specified in the form of a dictionary.
Learn more about the "Transaction isolation level" parameter. Sequential database operations can be divided into transactions. A transaction is a group of operations that represent a certain boolean unit of work with the database. For example, it is necessary to perform several operations with a table in order to update the data in it. If an error occurs, you can roll back the transaction, i.e. a group of operations made, so that you don't have to figure out at which step this error occurred.
If the checkbox "Transaction isolation level" is activated, part of the executed queries to the database will be in the form of transactions. - Set the parameters for the "Execute Sql Statement" action
- Click on the "Start" button in the top panel.
Result
The program robot completed successfully. The request has been fulfilled.
Обзор
Инструменты контента