Categories

Versions

Connecting to databases via JDBC

Altair AI Studio comes bundled with a few JDBC drivers that allow you to connect to various databases (MySQL, MSSQL, Oracle, Postgres, ...). If you want to connect to other databases, you need to manually download and configure their respective JDBC driver.

This article will walk you through how to:

In addition, the following pages give database-specific information:

Download a JDBC driver

Go to your favorite search engine, and enter the name of the database together with the word JDBC. This should lead you to a download page for most databases. The driver itself is usually a file named xyz.jar. Extract this file from the downloaded archive to a location on your hard drive that is accessible from Altair AI Studio. Note that for some databases, you need more than one jar file.

Create a new JDBC Connection

  1. In Altair AI Studio, right-click on the repository you want to store your Database Connection in and choose New Connection Icon Create Connection.

    ../img/create_new_connection.png

    You can also click on Connections > Create Connection New Connection Icon and select the repository from the dropdown of the following dialog.

  2. Give a name to the new Connection, and set Connection Type to Database Connection Icon Database:

    ../img/create_jdbc_connection.png

  3. Select the Database system from the list of predefined DBs, or choose a custom system.

    ../img/edit_jdbc_connection_system.png

    Fill out or adapt other necessary fields like User, Password, and Host.

  4. (This step is only necessary if you have selected a Custom Database system). Go to the Driver tab and select the previous downloaded xyz.jar as the JDBC driver Jar file. Note that the JAR file will be bundled inside the connection itself, so you can move or delete the downloaded file. If there are multiple JAR files, you may need to add them all. The documentation of the respective database should tell you what you need.

    ../img/edit_jdbc_connection_driver.png

  5. Use Test Connection IconTest connection to check your settings by connecting to the database. After a successful test, you can close the dialog by clicking on Save Icon Save.

Use the JDBC connection

Use the newly created JDBC Connection with the Read Database, Write Database or Update Database operator.

In the following example the first Read Database operator uses the repository setting of define connection to select the connection entry by its path. While the second Read Database operator is directly connected to the connection with its connection input port.

../img/read_database.png