Connect to Vantage using JDBC
Overview
This how-to demonstrates how to connect to Teradata Vantage using JDBC using a sample Java application: GitHub JDBC.
Prerequisites
- Access to a Teradata Vantage instance.
If you need a test instance of Vantage, you can provision one for free at https://clearscape.teradata.com
- JDK
- Maven
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:
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.