OXYGEN
HomeGitHubReleasesCommunity
  • Welcome to Oxygen
  • About
    • What is Oxygen?
    • Getting Started (Videos)
      • Oxygen IDE Controls Overview
      • Recording a Web Test
      • Oxygen Commands Explained
    • Getting help
  • Download and work with Oxygen
    • Download & Installation
      • Oxygen IDE Installation
      • Oxygen for Mobile Installation
      • Oxygen for Windows Desktop Automation Setup
      • Oxygen for Mac Installation
        • Mac Installation Troubleshooting
      • Oxygen CLI Installation
      • Java Installation Instructions
      • Recording Troubleshooting
    • Start working with Oxygen
      • Getting Started - Web
        • Introduction - Web Testing
        • Recording a Web Test
        • Creating a Web Test
        • Sample Project - Web Test
      • Getting Started - Mobile
        • Introduction - Mobile Testing
        • Recording a Test on Mobile
        • Creating a Test - Mobile
        • Sample Project - Mobile
      • Getting Started - Oxygen for Windows Desktop Automation
      • Getting Started- Oxyge CLI
        • Running a Test Script on Windows
        • Running Multiple Tests (Suites) on Windows
    • Oxygen Modules
      • assert
      • date
      • db
      • email
      • eyes
      • http
      • log
      • mailinator
      • mob
      • pdf
      • proxy
      • serial
      • shell
      • soap
      • twilio
      • utils
      • web
      • win
    • Test Parameters
  • Cloud Providers
    • Sauce Labs
    • Lambda Test
    • TestObject
  • Advanced programming in Oxygen
    • Project Configuration
    • Locating Elements
    • Page Objects
    • Environments
    • Code Components
Powered by GitBook
On this page
  • callProcedure
  • executeNonQuery
  • executeQuery
  • getScalar
  • setConnectionString

Was this helpful?

  1. Download and work with Oxygen
  2. Oxygen Modules

db

Provides methods for working with Data Bases through ODBC.

Before using this module, make sure to install unixodbc:

  • Windows - Install Windows SDK

  • OS X - brew install unixodbc

  • Linux - sudo apt-get install unixodbc unixodbc-dev or sudo dnf install unixODBC unixODBC-devel

callProcedure

Calls a stored procedure.

** Usage example:**

// calls a procedure which expects two input parameters and one output parameter.
var result = db.callProcedure('test', 3, 4, undefined);
log.info(result);

Parameters:

Name
Type
Description

name

String

Name of the procedure to call.

args

...Object

optional Procedure arguments. If procedure produces output parameters then these need to be specified using undefined.

Returns:

Object - Procedure output if any.

executeNonQuery

Executes SQL statement.

Any results from the query are discarded.

Parameters:

Name
Type
Description

query

String

The query to execute.

executeQuery

Executes SQL query and returns the result set.

Parameters:

Name
Type
Description

query

String

The query to execute.

Returns:

Object - The result set.

getScalar

Executes SQL query and returns the first column of the first row in the result set.

Parameters:

Name
Type
Description

query

String

The query to execute.

Returns:

Object - The first column of the first row in the result set, or null if the result set is empty.

setConnectionString

Sets DB connection string to be used by other methods.

This method doesn't actually open the connection as it's opened/closed automatically by query methods. Example connection strings: - Driver={MySQL ODBC 9.0 Unicode Driver};Server=localhost;Database=myDatabase; User=myUsername;Password=myPassword;Option=3; - Driver={Oracle in instantclient_11_2};dbq=127.0.0.1:1521/XE;uid=myUsername; pwd=myPassword;

Parameters:

Name
Type
Description

connString

String

ODBC connection string.

PreviousdateNextemail

Last updated 8 months ago

Was this helpful?