Spring DAO Project Setup - Teradata Studio

Teradata Studio IDE Plug-in User Guide

Product
Teradata Studio
Release Number
16.00
Published
March 2017
Language
English (United States)
Last Update
2018-05-03
dita:mapPath
poj1484765174891.ditamap
dita:ditavalPath
ft:empty
dita:id
B035-2043
Product Category
Teradata Tools and Utilities

The Spring DAO Wizard creates classes that requires the Spring and TestNG frameworks. Teradata has a recommended project setup to stream line the usage of classes generated by the Spring DAO Wizard.

Creating a Teradata Spring DAO Project

You can create a Spring DAO project automatically with the Teradata Project Wizard or create it manually. To create the Spring DAO project manually:
  1. Start Eclipse and open your workspace.
  2. Select File > New > Project > Java > Java Project.
  3. Click Next.
  4. In the New Java Project dialog type the Project name: TZA-InsuranceProcess

  5. Click Next.
  6. In the Java Settings dialog open the Source tab and select the src directory.
  7. Select Remove source folder 'src' from build path.


  8. Select the Create a new source Folder link.
  9. Specify the Folder name as src/java. and click Finish.
  10. Repeat the above steps for the remainder of the normal Source folders. The folders are:
    • src/config
    • src/resources
    • test/java
    • test/config
  11. Change the Default Output folder to TZA-InsuranceProcess/build.
  12. Click Finish.

Adding External Libraries (JAR Files) to "/lib" Directory.

Within the Spring DAO project, wherever you plan to use external Libraries (JAR files), place the files in a User Library directory (/lib) which can then be referenced as part of the Class Path of the application.
  1. Right-click TZA-InsuranceProcess and select New > Folder.
  2. Type the Folder name: = 'lib'.
  3. Click Finish.

When you need to add an external library such as the Spring JAR, you can download a copy of the required library, save the required JAR files to the /lib directory, and then add them to the application classpath. Typically the library downloads come as a large.ZIP or TAR file that requires you to extract the required JAR files using the approach appropriate for your operating system, such as WinZip on Windows.

Adding Spring Framework JARs

You can employ the Spring Framework to use with the classes generated by the Spring DAO Wizard. Download the spring-framework version 2.5.6 with dependencies and extract the following files to your /lib directory:
  • spring.jar
  • spring-test.jar
  • commons-logging.jar
  • testng-5.8.jar
The JAR locations in the spring-framework-2.5.6-with-dependencies.zip are located in the following directories:
JAR File Location
spring.jar spring-framework-2.5.6\dist
spring-test.jar spring-framework-2.5.6\dist\modules
commons-logging.jar spring-framework-2.5.6\lib\jakarta-commons
testng-5.8-jdk15.jar spring-framework-2.5.6\lib\testng

Adding iBatis JAR

If you are going to implement a DAO with an iBatis SQL Map, download the iBatis JAR file version 2.3.4 from the iBatis website and extract the ibatis-2.3.4.726.jar from the lib directory of the download ZIP file. After you do this, copy the iBatis JAR file to the /lib directory of your project.

Creating a User Library Classpath Reference to JAR Files in /lib

After you add the JAR files to the /lib directory, you can add them to the project classpath within Eclipse. This allows Eclipse to make these classes available within the editing environment and compile all of the code without errors.
  1. Right-click TZA-InsuranceConsole and select Build Path > Configure Build Path.
  2. In the Properties for TZA-InsuranceConsole dialog, select the Librariestab.
  3. Click Add Library....
  4. In the Add Library dialog, select User Library.

  5. Click Next.
  6. In the Preferences dialog, select the User Libraries node and click New.
  7. In the New User Library dialog, type a User Library name; for example, InsuranceConsoleLibrary.

  8. Click Add JARs to browse to the TZA-InsuranceConsole/lib directory and include all of the JAR files on the classpath (in the InsuranceConsoleLibrary).

  9. The InsuranceConsoleLibrary and associated JAR files appear in the Project Explorer.

For more information about the Spring Framework, please refer to the Spring website and the Spring overview tutorial.