今天試著直接用jdbc連一下Teradata,報了下面的錯:
GSSException: Failure unspecified at GSS-API level (Mechanism level: UserFile parameter null) at com.teradata.tdgss.jtdgss.TdgssParseXml.<init>(DashoA1*..) at com.teradata.tdgss.jtdgss.TdgssConfigApi.<init>(DashoA1*..) at com.teradata.tdgss.jtdgss.TdgssManager.<init>(DashoA1*..) at com.teradata.tdgss.jtdgss.TdgssManager.getInstance(DashoA1*..) at com.teradata.jdbc.jdbc.GenericTeraEncrypt.getGSSM(GenericTeraEncrypt.java:622) at com.teradata.jdbc.jdbc.GenericTeraEncrypt.getConfig(GenericTeraEncrypt.java:640) at com.teradata.jdbc.jdbc.GenericTeraEncrypt.getUserNameForOid(GenericTeraEncrypt.java:733) at com.teradata.jdbc.AuthMechanism.<init>(AuthMechanism.java:50) at com.teradata.jdbc.jdbc.GenericInitDBConfigState.action(GenericInitDBConfigState.java:104) at com.teradata.jdbc.jdbc.GenericLogonController.run(GenericLogonController.java:49) at com.teradata.jdbc.jdbc_4.TDSession.<init>(TDSession.java:201) at com.teradata.jdbc.jdbc_3.ifjdbc_4.TeraLocalConnection.<init>(TeraLocalConnection.java:99) at com.teradata.jdbc.jdbc.ConnectionFactory.createConnection(ConnectionFactory.java:54) at com.teradata.jdbc.TeraDriver.doConnect(TeraDriver.java:218) at com.teradata.jdbc.TeraDriver.connect(TeraDriver.java:151) at java.sql.DriverManager.getConnection(DriverManager.java:512) at java.sql.DriverManager.getConnection(DriverManager.java:171) at myservlet.Action.main(Action.java:48)
查了一會,發現原來Teradata需要3個包,而我只給了1個包。
terajdbc4.jar
tdgssjava.jar
tdgssconfig.jar
說實話,我覺得Teradata將jdbc所需設計成3個包也許是個缺陷吧,對初學者不友好噢。