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
- Start Eclipse and open your workspace.
- Select .
- Click Next.
- In the New Java Project dialog type the Project name: TZA-InsuranceProcess
- Click Next.
- In the Java Settings dialog open the Source tab and select the src directory.
- Select Remove source folder 'src' from build path.
- Select the Create a new source Folder link.
- Specify the Folder name as src/java. and click Finish.
- Repeat the above steps for the remainder of the normal Source folders. The folders are:
- src/config
- src/resources
- test/java
- test/config
- Change the Default Output folder to TZA-InsuranceProcess/build.
- Click Finish.
Adding External Libraries (JAR Files) to "/lib" Directory.
- Right-click TZA-InsuranceProcess and select .
- Type the Folder name: = 'lib'.
- 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
- spring.jar
- spring-test.jar
- commons-logging.jar
- testng-5.8.jar
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
- Right-click TZA-InsuranceConsole and select .
- In the Properties for TZA-InsuranceConsole dialog, select the Librariestab.
- Click Add Library....
- In the Add Library dialog, select User Library.
- Click Next.
- In the Preferences dialog, select the User Libraries node and click New.
- In the New User Library dialog, type a User Library name; for example, InsuranceConsoleLibrary.
- Click Add JARs to browse to the TZA-InsuranceConsole/lib directory and include all of the JAR files on the classpath (in the InsuranceConsoleLibrary).
- 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.