Connect to Vantage using JDBC

Author: Adam Tworkiewicz
Last updated: November 14th, 2022

Overview

This how-to demonstrates how to connect to Teradata Vantage using JDBC using a sample Java application: https://github.com/Teradata/jdbc-sample-app.

Prerequisites

Add dependency to your maven project

Add the Teradata JDBC driver as a dependency to your Maven POM XML file:

Code to send a query

This step assumes that your Vantage database is available on localhost on port 1025. If you are running Vantage Express on your laptop, you need to expose the port from the VM to the host machine. Refer to your virtualization software documentation how to forward ports.

The project is set up. All that is left, is to load the driver, pass connection and authentication parameters and run a query:

Run the tests

Run the tests:

mvn test

Summary

This how-to demonstrated how to connect to Teradata Vantage using JDBC. It described a sample Java application with Maven as the build tool that uses the Teradata JDBC driver to send SQL queries to Teradata Vantage.

Further reading

If you have any questions or need further assistance, please visit our community forum where you can get support and interact with other community members.
Did this page help?