Wednesday, September 24, 2014

Teradata datasource creation in weblogic server

If you have a requirement to create a web application talking to Teradata DB and deploy the application to Weblogic server then you need a generic datasource pointing to the Teradata DB and jndi name for the DS.

I have faced similar requirement to create an ADF application talking to Teradata DB  and I created the DS created using the following steps. I am able to successful use the JNDI corresponding to the datasource in ADF model Applciation Module configurations.

The below are the instructions to create a datasource.
  1. Make sure Teradata jdbc libraries terajdbc4.jar and tdgssconfig.jar are present in the weblogic server classpath. You can download these libraries from Teradata forums.
    • Copy the jars terajdbc4.jar and tdgssconfig.jar to WLS installation directory <WLS_HOME>\server\lib
    •  Add these two jars to the WEBLOGIC_CLASSPATH variable in commEnv.sh configuration file. 
      • File location: in the WLS installation directory <WL_HOME>\common\bin\commEnv.sh
      • Add classpath: ${CLASSPATHSEP}${WL_HOME}/server/lib/terajdbc4.jar${CLASSPATHSEP}${WL_HOME}/server/lib/tdgssconfig.jar
      • Note: Here the CLASSPATHSEP is a delimiter

  1.         Login to WLS console and navigate to Service à Data Sources
  2. New à Generic Data Source
    • Name: teradataDS
    • JNDI Name:  jdbc/teradataDS
    • Database Type: Other
  3. Next à Next à Uncheck ‘Supports Global Transactions’ à Next 
    • Database User Name:  tera_username 
    • Password: *****
  4.  Nextà
    • Driver Class Name: com.teradata.jdbc.TeraDriver
    • Connection URL: jdbc:teradata://<database host >
    • Properties: user=tera_username
  5. Next à
    • Select Targets: managedserver_1
  6. Save the changes and bounce the servers if required.
Hope it is useful.

Reference: http://developer.teradata.com/doc/connectivity/jdbc/reference/current/WebLogic103.html


Tuesday, September 23, 2014

Jdeveloper IDE Connection to the Teradata database

If you want to create an IDE connection in Jdeveloper IDE and pointing to Teradata database, the below are the steps.

  1. Download the latest jdbc drivers from Teradata website https://downloads.teradata.com/download/connectivity/jdbc-driver
  2. Open the menu option Application ---> Default Project Properties in Jdev
  3. Libraries and Classpath tab ---> click on Add Library --> New
  4. Give a name 'Teradatalibs' to the library and select Classpath, then click on Add Entry and choose both the jars terajdbc4.jar and tdgssconfig.jar from the earlier downloaded zip. So far we have created a new project library with jdbc drivers required for making a connection to the Teradata DB.
  5. Navigate to IDE Database Navigator and right click IDE connection and + icon there.
  6. Click New for Driver class, give the class name as com.teradata.jdbc.TeraDriver and browse for the library 'Teradatalibs' created in the step 4.
  7. Give User name & password,  and need to enter the JDBC url something like jdbc:teradata://<DB HOST NAME>
  8. Test for connection, it will be success if the details entered are correct.

Screen shot below.



Hope it helps.