back to forum.

Topic: Connecting to Teradata DB

Topic by
newerakb

2009-10-15
12:48

Connecting to Teradata DB

I'm trying to connect to a Teradata DB in the Profiler, but am having issues.

I've registered the "com.teradata.jdbc.TeraDriver" driver, but when I try to connect with a connect string like "jdbc:teradata://{address}", put in the correct id/pw and click "Connect to Database", nothing happens. I don't get an error message, the window doesn't disappear, the program doesn't crash...nothing happens.

I've used this Teradata driver and connect string in my own Java apps, so I know that part is correct. Is there something else I need to set up?

Reply by
kasper

2009-10-16
06:59
Hi newerakb,

For the next version of DataCleaner we've fixed a bug which I think is what is causing your problem (ie. the bug is that we need to show the user an error message that is otherwise only logged). You can do either of two things:
  • Run DataCleaner using the .cmd or .sh commands, which will make the command line appear in the background of the application. You should be able to see the error exception in the command line.
  • Download the latest snapshot of our development version which has the bug fixed: get it here

Reply by
newerakb

2009-10-16
12:28
Thanks for the reply. I tried the new version and am now seeing the following error (actual address masked):
java.sql.SQLException: No suitable driver found for jdbc://{address}

I have the driver registered, the logfile shows this:
INFO main dk.eobjects.datacleaner.gui.model.DatabaseDriver - Loaded class: com.teradata.jdbc.TeraDriver

Again, I've used this exact driver with this exact connect string in other Java apps, so I'm fairly certain that isn't the issue. Since all the profiler asks for is a connect string, id, and pw, how does it know which driver to use to connect?

Thanks again

Reply by
newerakb

2009-10-16
13:29
Okay, I've solved that problem, and of course ran into another. I just needed to add "teradata:" to my connect string, like "jdbc:teradata://{address}".

Here's my current issue. When using Teradata JDBC, two driver files are requires. There's the main file, "terajdbc4.jar", and a config file, "tdgssconfig.jar". Both are required to connect using JDBC.

The problem is that the config jar doesn't actually contain a Java class, so I can't register it within the DataCleaner application. All it contains is a manifest and an xml file. I've added both the filepath and the directory path where the jar resides to my own CLASSPATH variable in Windows, but I still get the error messages associated with the config jar missing.

Any suggestions?

Reply by
newerakb

2009-10-16
14:08
Just to keep this updated, section 1.5 on the following link has a situation involving this gss configuration file
[http://www.teradata.com/DownloadCenter/Topic9364-98-1.aspx]

I added the path to the xml file to the classpath and I still can't connect. So it looks like I won't be able to use DataCleaner without having some extra mechanism for registering a driver without a class.

Reply by
kasper

2009-10-16
15:10
Hi newerakb,

I see your problem. It's true that you can't put additional non-driver JARs on the classpath from within the application. You can however edit the .cmd/.sh file to include them in the classpath when starting up the JVM.

In the .cmd, here's how to do it:

1. Open datacleaner.cmd file in a text editor (eg. notepad or similar)
2) Go to the last line of the file and remove this part (the ending of the line):
-jar datacleaner.jar
3) Instead enter:
-cp datacleaner.jar;tdgssconfig.jar dk.eobjects.datacleaner.gui.DataCleanerGui

Reply by
kasper

2009-10-16
15:11
(the previous post is assuming the the "tdgssconfig.jar" file is placed in your datacleaner directory.

Reply by
newerakb

2009-10-16
16:40
Thanks kasper, that worked beautifully! Working with Teradata I've learned to not get my hopes up with regard to finding any help with 3rd-party tools. Glad it worked out this time.

Thanks again.

Reply by
kasper

2009-10-16
17:16
Very glad it worked! I guess we can brag a bit about that in the datacleaner crew then ;-)

Reply by
newerakb

2009-10-16
17:38
I guess I can confirm then that "com.teradata.jdbc.TeraDriver" is the correct classname, and "jdbc:teradata:{address}" is the correct connect string, in case you ever feel like adding it to the default list.

Reply by
kasper

2009-10-17
07:36
Hehe I've gone and added it right away.

Reply by
sheridany

2011-03-12
02:45
I downloaded the windows version but all reference here to the platform independent version. Is there a way to make a teradata connection work on the windows version?

Reply by
sheridany

2011-03-12
03:46
Here is the log I am getting. I changed the class to point to the jar files in the datacleaner directory.


Could not establish connection


Message:
java.lang.NullPointerException
Level:
SEVERE
Stack Trace:
null
com.teradata.tdgss.jtdgss.TdgssConfigApi.GetMechanisms(DashoA1*..)
com.teradata.tdgss.jtdgss.TdgssManager.<init>(DashoA1*..)
com.teradata.tdgss.jtdgss.TdgssManager.getInstance(DashoA1*..)
com.teradata.jdbc.jdbc.GenericTeraEncrypt.getGSSM(GenericTeraEncrypt.java:583)
com.teradata.jdbc.jdbc.GenericTeraEncrypt.getConfig(GenericTeraEncrypt.java:601)
com.teradata.jdbc.jdbc.GenericTeraEncrypt.getUserNameForOid(GenericTeraEncrypt.java:694)
com.teradata.jdbc.AuthMechanism.<init>(AuthMechanism.java:50)
com.teradata.jdbc.jdbc.GenericInitDBConfigState.action(GenericInitDBConfigState.java:105)
com.teradata.jdbc.jdbc.GenericLogonController.run(GenericLogonController.java:49)
com.teradata.jdbc.jdbc_4.TDSession.<init>(TDSession.java:196)
com.teradata.jdbc.jdbc_3.ifjdbc_4.TeraLocalConnection.<init>(TeraLocalConnection.java:94)
com.teradata.jdbc.jdbc.ConnectionFactory.createConnection(ConnectionFactory.java:55)
com.teradata.jdbc.TeraDriver.doConnect(TeraDriver.java:216)
com.teradata.jdbc.TeraDriver.connect(TeraDriver.java:149)
org.eobjects.datacleaner.database.DriverWrapper.connect(DriverWrapper.java:47)
java.sql.DriverManager.getConnection(Unknown Source)
java.sql.DriverManager.getConnection(Unknown Source)
org.eobjects.analyzer.connection.JdbcDatastore.createConnection(JdbcDatastore.java:160)
org.eobjects.datacleaner.windows.JdbcDatastoreDialog$4.actionPerformed(JdbcDatastoreDialog.java:272)
javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
javax.swing.DefaultButtonModel.setPressed(Unknown Source)
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
java.awt.Component.processMouseEvent(Unknown Source)
javax.swing.JComponent.processMouseEvent(Unknown Source)
java.awt.Component.processEvent(Unknown Source)
java.awt.Container.processEvent(Unknown Source)
java.awt.Component.dispatchEventImpl(Unknown Source)
java.awt.Container.dispatchEventImpl(Unknown Source)
java.awt.Component.dispatchEvent(Unknown Source)
java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
java.awt.Container.dispatchEventImpl(Unknown Source)
java.awt.Window.dispatchEventImpl(Unknown Source)
java.awt.Component.dispatchEvent(Unknown Source)
java.awt.EventQueue.dispatchEvent(Unknown Source)
java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
java.awt.EventDispatchThread.pumpEvents(Unknown Source)
java.awt.EventDispatchThread.pumpEvents(Unknown Source)
java.awt.EventDispatchThread.run(Unknown Source)

You need to be logged in to participate

In order to post your own comments on this topic, you need to be logged in.

Username:

Log in by clicking the login link at the top of the screen