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

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
DATABASE TYPEDB typeRobin.String
Yes
LoginLogin to connect the databaseRobin.String
No
PasswordPassword to connect the databaseRobin.Object
No
Server hostServer hostRobin.String
No
Server portServer portRobin.Numeric
No
DB nameDB nameRobin.String
No
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
Transaction isolation levelEnable the mode of using transactions inside the connectionRobin.BooleantrueNo
ParametersAdditional connection parameters in the form of a dictionaryRobin.Dictionary
No
Results
DB contextConnection context to the selected databaseRobin.DbContextDatabase 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

  1. Assemble a robot scheme consisting of actions:
  2. 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. 
  3. Set the parameters for the "Execute Sql Statement" action. 
  4. Click on the "Start" button in the top panel. 

Result

The program robot completed successfully. The request has been fulfilled. 

  • Нет меток