フィルターのクリア

Connecting to Teradata Database

9 ビュー (過去 30 日間)
Mark Whirdy
Mark Whirdy 2014 年 1 月 20 日
回答済み: Mark Whirdy 2014 年 1 月 20 日
Hi all
For anyone with experience connecting to Teradata Database and/or in-the-know about java database connectivity, would be grateful for your assistance in troubleshooting the java-layer error below.
The database.m function throws an error at line 310 (2012b)
connectionVector = makeDatabaseConnection(conn);
when I try to connect by:
database('test_dal','USER','PASS','com.teradata.jdbc.TeraDriver','jdbc:teradata://tdprddub/TMODE=TERA');
I have replaced the real username & password with "USER" & "PASS" here which are correct (since i can connect successfully by TeraData Studio).
I have inserted the java driver reference in classpath.txt with
C:\Program Files\Teradata\Client\14.00\Teradata Studio nt-x8664\plugins\com.teradata.datatools.terajdbc_14.2.0.201302060329\terajdbc4.jar
Which is the correct location. It seems like there must be some minor syntax issue with the Driver or URL arguments passed into the database.m function.
I realise this is impossible to debug but hoping somebody on a longshot has had similar issues.
conn = database('test_dal','USER','PASS','com.teradata.jdbc.TeraDriver','jdbc:teradata://tdprddub/TMODE=TERA');
GSSException: Failure unspecified at GSS-API level (Mechanism level: UserFile parameter null)
at com.teradata.tdgss.jtdgss.TdgssParseXml.<init>(Unknown Source)
at com.teradata.tdgss.jtdgss.TdgssConfigApi.<init>(Unknown Source)
at com.teradata.tdgss.jtdgss.TdgssManager.<init>(Unknown Source)
at com.teradata.tdgss.jtdgss.TdgssManager.getInstance(Unknown Source)
at com.teradata.jdbc.jdbc.GenericTeraEncrypt.getGSSM(GenericTeraEncrypt.java:623)
at com.teradata.jdbc.jdbc.GenericTeraEncrypt.getConfig(GenericTeraEncrypt.java:641)
at com.teradata.jdbc.jdbc.GenericTeraEncrypt.getUserNameForOid(GenericTeraEncrypt.java:734)
at com.teradata.jdbc.AuthMechanism.<init>(AuthMechanism.java:50)
at com.teradata.jdbc.jdbc.GenericLogonController.run(GenericLogonController.java:122)
at com.teradata.jdbc.jdbc_4.TDSession.<init>(TDSession.java:214)
at com.teradata.jdbc.jdk6.JDK6_SQL_Connection.<init>(JDK6_SQL_Connection.java:34)
at com.teradata.jdbc.jdk6.JDK6ConnectionFactory.constructConnection(JDK6ConnectionFactory.java:22)
at com.teradata.jdbc.jdbc.ConnectionFactory.createConnection(ConnectionFactory.java:130)
at com.teradata.jdbc.jdbc.ConnectionFactory.createConnection(ConnectionFactory.java:120)
at com.teradata.jdbc.TeraDriver.doConnect(TeraDriver.java:232)
at com.teradata.jdbc.TeraDriver.connect(TeraDriver.java:158)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at com.mathworks.toolbox.database.databaseConnect.makeDatabaseConnection(databaseConnect.java:369)

採用された回答

Mark Whirdy
Mark Whirdy 2014 年 1 月 20 日
I needed to add tdgssconfig.jar to classpath too.

その他の回答 (1 件)

Friedrich
Friedrich 2014 年 1 月 20 日
編集済み: Friedrich 2014 年 1 月 20 日
Hi,
what happens if you try
conn = database('test_dal','USER','PASS','com.teradata.jdbc.TeraDriver','jdbc:teradata://SERVERNAME/database=DATABASENAME,tmode=ANSI,charset=UTF8');
  2 件のコメント
Mark Whirdy
Mark Whirdy 2014 年 1 月 20 日
Hi Friedrich
conn = database('test_dal','USER','PASS','com.teradata.jdbc.TeraDriver','jdbc:teradata://tdprddub/database=DAL_USER,tmode=ANSI,charset=UTF8');
It doesn't throw an error, but
>> isconnection(conn) ans = 0
Friedrich
Friedrich 2014 年 1 月 20 日
編集済み: Friedrich 2014 年 1 月 20 日
Take a look at the variable conn. It should have a field called Message. In there should be the error/any message from the driver. What is in there? In the case the message field is empty then you should be connected. Simply try to get some data from the database and see what happens.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDatabase Toolbox についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by