Using the Teradata JDBC Driver from Maven Central

Tan Nguyen
Teradata
Published in
2 min readMar 10, 2023
Photo by Glenn Carstens-Peters on Unsplash

Teradata is a popular database management system many large enterprises use for their data warehousing and analytics needs. If you’re a Java developer working with Teradata, you know that having a reliable JDBC driver is crucial to your application’s success.

I’m excited to announce that the Teradata JDBC driver is now available on Maven Central, providing Java developers with a fast and reliable way to connect to Teradata databases.

The driver is designed to provide high performance and ease of use, supporting the latest features of Teradata and Java. It enables Java applications to communicate with Teradata using the JDBC API, including support for transactions, prepared statements, and result sets.

One of the key benefits of this driver is its compatibility with the latest versions of Java and Teradata, ensuring that developers can take advantage of the latest features and improvements in both technologies without worrying about compatibility issues.

Using the Teradata JDBC driver is straightforward. Simply add the driver to your project’s dependency list. Here’s an example of how to use this driver in a Maven project:

<dependency>
<groupId>com.teradata.jdbc</groupId>
<artifactId>terajdbc</artifactId>
<version>20.00.00.06</version>
</dependency>

Here are examples of how to include the driver in other build tools:

Gradle:

implementation 'com.teradata.jdbc:terajdbc:20.00.00.06'

Gradle (Kotlin):

implementation("com.teradata.jdbc:terajdbc:20.00.00.06")

Leiningen:

[com.teradata.jdbc/terajdbc "20.00.00.06"]

Buildr:

'com.teradata.jdbc:terajdbc:jar:20.00.00.06'

You can then connect to the database by doing:

import java.sql.*;

public class Main {
public static void main(String[] args) {
String url = "jdbc:teradata://hostname/database";
String user = "username";
String password = "password";
try (Connection conn = DriverManager.getConnection(url, user, password)) {
// Do something with the connection
} catch (SQLException e) {
e.printStackTrace();
}
}
}

You can find a detailed example in our Connect to Vantage using JDBC tutorial.

By installing the Teradata JDBC driver from Maven Central, you can use other Maven plugins with the Teradata JDBC driver. An example of it is using Versions Maven Plugin to check if there is a newer version of the Teradata JDBC driver and update it if needed:

Users can use this command to check if there is a newer version of the Teradata JDBC driver:

mvn versions:display-dependency-updates

Then, users can update it if needed using the command:

mvn versions:update-properties

Overall, the Teradata JDBC driver is a valuable addition to the Java developer’s toolbox, providing fast and reliable connectivity to Teradata databases. Its availability on Maven Central makes it easy to add to any Java project, so give it a try and see how it can help you build better Teradata applications.

--

--