Create a Teradata Project using the Teradata Plug-in for Eclipse

Tools
Tools covers the tools and utilities you use to work with Teradata and its supporting ecosystem. You'll find information on everything from the Teradata Eclipse plug-in to load/extract tools.
Teradata Employee

Create a Teradata Project using the Teradata Plug-in for Eclipse

The Teradata project is an extension of a Java project in Eclipse and it can be created by using the Teradata Project Wizard. This new type of project is set up based on Teradata Standards which can be overridden with preferences. The Teradata project will give you access to Teradata libraries. These libraries will give you access to Java Stored procedure utilities and new query banding functionality. The Teradata Plug-in for Eclipse Wizards are enhanced to take advantage of the new functionality from the Teradata libraries. The Teradata Project gives you a more comprehensive approach on using Teradata products with Java development. This article will show you how to setup the Teradata project. Also this will be the starting point for any tutorials using the Teradata Development Wizards because the Teradata Project is the first building block on creating Java based Teradata applications.

Unknown Object

Prerequisite for this Article

If you have not worked through the guide Getting Started with Teradata Plug-in for Eclipse, do so now before you continue.

Teradata Libraries

The Teradata Libraries give you access to Java Stored procedures utilities (javFnc) and new query banding functionality using the Teradata Access Session Manager. The Teradata Plug-in for Eclipse Wizards are enhanced to take advantage of the new functionality from the Teradata libraries.

The javFnc.jar contains the DBS Java classes used to handle JARs, JDBC helper functions, and parameter helper functions. It is part of the 12.0 and 13.0 Teradata Databases. This JAR can be used with the Java User Defined Function and Java Stored Procedure Multi-Page Editors. The Documentation for javaFnc JAR is in the online publication "SQL External Routine Programming" Release 13.0 (B035-1147-098A).

The Teradata Access Session Manager handles the Teradata Access Session class and Query band configuration. The Teradata Access Session controls and wraps Query Banding for a database transaction. A Transaction Query band will be set at the beginning of a transaction and then released at the end of a transaction using the Teradata Access Session Manager User interface.

The Teradata Access Session Manager has both an iBatis and JDBC implementation that is supported by the Teradata Plug-in for Eclipse. These implementations are available in the tdcommons-access JAR file. The Query band information used with Teradata Access Session Manager can be accessed from the ThreadLocalContext class which is available in the tdcommons-context Jar file. These JAR files are used with the Spring DAO Wizard creating a Java Bean or iBatis data access layer.

All of these JAR files are made available when a Teradata Project is created and used.

Teradata Project Preferences

The Teradata Project preferences should be setup first before you create a Teradata Project. The Teradata Project preferences is accessed by first selecting the “Window” menu item in the top menu bar of the main Eclipse window and then selecting the Preferences menu item. The Teradata Project Preferences is under the Teradata Data tools Preferences in the tree of the Preferences popup dialog.

The Teradata Project Preferences are comprised of two groups. The first group is Project Folders, which lets the user define the source folders and the output directory defaults for the Teradata Project. This group will already have the Teradata Project standard values set for the defaults when the group first comes up.

The second group is the Project Libraries. The Project Libraries group lets the user set the default libraries needed for the Teradata Spring DAO and Java Wrapper Bean Wizards. These libraries are included with Teradata Plug-in for Eclipse so these text fields are pre-populated with the jar locations. When the Teradata project is created these libraries will be copy to the lib directory of the new project. Also a user library will be created for the copied jars and added to the build path of the project.

List of Teradata Project Source folders

  • Source Java — Source folder of Java Source
  • Source Configuration — Configuration Source
  • Source Resource — Application resource files
  • Test Java — Java Source Test files
  • Test Configuration — Configuration for Tests

Two versions of the Spring framework can be used with the classes generated by the Teradata iBatis (MyBatis) Wizards. If the Spring 3.05 radio button is selected, the Jars which support Spring 3.0.5 and MyBatis frameworks will be used when the Teradata Project is created. The Teradata Project created with these Jars will only support the Spring 3.0.5 and MyBatis frameworks. If the Spring 2.5.6 radio button is selected, the Jars which support Spring 2.5.6 and iBatis frameworks will be used when the Teradata Project is created. The Teradata Project created with these Jars will only support the Spring 2.5.6 and iBatis frameworks.

Teradata Project Wizard

Once you have set up your Teradata Project preferences, you will be ready to use the Teradata Wizard. This Wizard uses the Teradata Project Preferences to create the source directories and the class path to the jars needed for the Teradata Java development Wizards.

Launch Wizard

The Teradata Project Wizard can be launched by selecting File->New->Other… from the top menu bar of the Eclipse IDE main window or right click in the Package Explorer and select File->New->Other… Either one of these selection methods will bring up the new popup dialog. In the popup dialog, select Teradata Wizards-> Teradata Project from the tree list to launch the wizard.

Create a Java Project Wizard page

The first Screen of the wizard is the same as the Eclipse New Java Project Wizard.

Java Settings

The next page is the Java Settings Wizard page. This page is the same as the New Java Project Wizard but the defaults for this page are from the Teradata project preferences page such as the source folder, output directory and build path. The build path includes the Teradata libraries.

Teradata Project Defaults

The third page of the Wizard overrides the defaults for the source folders from Teradata Project preferences. These source folders are used with the Teradata Java development Wizards. If the source folders are not produced when the Teradata project is created, the source folders are created when needed by the Teradata Java Development Wizards.

Teradata Project Setup Completed

Once you select the finish button in the Wizard, the Teradata Project will be created. All the directories and libraries you specified in the Teradata Project Wizard will now be setup as illustrated below:

The Java stored procedure, JavaBean, and Spring iBatis Wizards can now take advantage of the new directory structures and functionality from the Teradata libraries. Using the Teradata Wizard will reduce your setup time and give you a consistent and comprehensive approach to developing your Teradata Applications.