Connect custom DB Version 10 (Java)

Action group: DB General 


Description

The action connects to database with set connection parameters. 

More details can be found here:Instruction on Connecting to Microsoft SQL Server from Robin Studio

Action icon

Parameters

Input parameters 

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

Login login to connect to database.

Password – password to connect the database.

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

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

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

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 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 (Oracle, MySql, PostgreSql,MsSqlServer), 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: 
  2. 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 allowed - it will be allowed to read data that is modified by some other transaction.
    3. read committed - the robot will only be allowed to read the recorded entries.
    4. 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. 
    5. 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. 

  3. 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:

    Value in the "Timeout" field is measured in seconds.


  4. Set the "Execute statement" action parameters.      
  5. Click "Start" in the top panel. 

Result

The program robot completed successfully. The statement was executed. 

 

  • Нет меток