Database Integrations

 

  • Navigate to SETTINGS → DATA SOURCES

  • Select your Database and click SETUP

  • SAVE your DB connection strings.

 

  • Use the connection with in your Code.

 

 

const { DB } = require('../setup/database-connector'); before(async function () { connection = await DB.mySqlConnection( process.env.db_host, process.env.db_user, process.env.db_password, process.env.db_name ); // await driverHelper.getDriver((connector) => { // driver = connector; // }); }); it('Step_16624', async function () { connection.connect((err) => { if (err) console.log(err); console.log('connection successfuly'); }); });

 

 

 

import java.sql.Connection; public void BeforeAll() throws MalformedURLException, Exception { driver = DriverManager.CreateDriver(); _connection = DatabaseConnector.GetMySqlConnection(System.getenv("db_host"), System.getenv("db_user"), System.getenv("db_password"), System.getenv("db_name") ); }

 

private MySqlConnection _connection; _connection = DatabaseConnector.CreateMysqlConnection( Environment.GetEnvironmentVariable("db_host"), Environment.GetEnvironmentVariable("db_user"), Environment.GetEnvironmentVariable("db_password"), Environment.GetEnvironmentVariable("db_name") );