ODBC Administration
You can access databases from Eggplant Functional using the Open Database Connectivity (ODBC) API in SenseTalk. This makes data-driven testing from SenseTalk using a variety of databases possible, including but not limited to Oracle, MySQL, and Microsoft SQL Server.
Once you have set up the connection using the information below, test it to ensure the connection is working before trying to define the connection in an Eggplant Functional script. This can be tested using the DSN in your ODBC Administrator or odbc.ini file.
Prerequisites
Requirements for using ODBC vary between operating systems. That said, accessing a database using ODBC requires three things:
- ODBC Driver: This allows Eggplant Functional and the target database to communicate. You must install the appropriate driver for the type of database you want to access. Install this driver on the machine where you run Eggplant Functional, and make sure it is the same version (32-bit or 64-bit) as your installation of Eggplant Functional.
- OCBC Driver Manager: This manages the ODBC driver and allows Eggplant Functional to load and use the ODBC driver. See Driver Managers below. Not necessary on Linux.
- Data Source Information: This information specifies the connection information for your specific database, and must include the server name, IP address, port, and credentials. This information is part of your Data Source Name (DSN) definition. The DSN is defined in your ODBC Administrator or odbc.ini file.
Driver Managers
The Driver Manager manages the ODBC driver and allows Eggplant Functional to load and use the ODBC driver.
Windows
The ODBC driver manager on Windows is called the ODBC Data Source Administrator. It manages and loads the ODBC drivers, and it also provides a graphical user interface (GUI) where you can configure DSNs. Windows 8, and Windows 10 provide an ODBC administrator for 64-bit applications. This administrator can be found in the following location:
- The 64-bit ODBC Administrator:
C:\Windows\system32\odbcad32.exe
.
You must also download the appropriate 64-bit ODBC driver for your database. To connect to MySQL, for example, you’ll need to download a 64-bit ODBC driver.