How To Work With Teradata Using Java?

Teradata- Basic working knowledge of java and database
Teradata is one of the leading vendor in data analyticsconnectivity using JDBC
and data warehousing applications and softwares.- A valid teradata database
Especially the Teradata RDBMS is widely used acrossStep I:
various industries like airlines, logistics, Insurance, RetailInstall the right version of Teradata Driver for the
etc. Teradata DBMS is known for its ruggedness,JDBC Interface. Make sure that TERAJDBC variable
scalability, handling complex queries to retrieve datais present in your environmental variables. If not set it
and ofcourse for the better load balancing. Teradatato the folder where you have installed the driver.eg)
can be interfaced by any CLI (Call Level Interface) ,TERAJDBC = C:/NCR/TeraJDBC
JDBC (Java Database Connectivity) and ODBC (OpenStep II:
Database Connectivity) clients. In this article we willPlease place the following files in your client classpath.
look into how to query teradata in 3 steps using theThe client can be a plain-java client or can be a web
widely used language Java programmatically.client. In case of web client pls place the files in the
Using Teradata driver for JDBC Interfaceserver classpath.
In this tutorial we are going to look at the example of a- TdgssUserConfigFile.xml - configuration file for
Java client interacting with Teradata using Teradatateradata
driver for JDBC Interface. The java client can be a- terajdbc4.jar - teradata drivers for JDBC Interface
normal java class or an applet. JDBC is an interfacejars
provided by Sun allows applications to interact with- tdgssjava.jar - teradata drivers for JDBC Interface
different databases irrespective of the vendor andjars
platform. To interact with Teradata, the TeradataStep III:
driver for JDBC Interface needs to be installed first byIntegrate the following code to connect to terradata
downloading it from the site. More information isdatabase
provided in the below given section. The Teradata/* Create the URL that is needed to connect to the
driver for JDBC Interface is nothing but a bridge builtTeradata RDBS */
with java classes that helps to interact with JDBCString databaseURL = "jdbc:teradata://127.0.0.1
Interface to work with Teradata database.schema";
Java Client ----> Teradata JDBC Bridge ---->/* Loads the driver */
JDBC ----> Teradata RDBMSClass.forName("com.ncr.teradata.TeraDriver");
Teradata driver for JDBC Interface uses a 3 tier/* Creates the connection to teradata database using
architecture to access the Teradata database and it isdriver for JDBC Interface */
the only because the database IPs will not be exposedConnection c =
to clients directly. So Teradata driver for JDBCDriverManager.getConnection(databaseURL,
Interface acts as a Teradata JDBC Gateway.databaseUserName, databaseUserpassword);
Assumptions:Replace 127.0.0.