When using a Java Stored Procedure from within the Oracle 11g database, an attempt to open a connection to Teradata using the JDBC driver version 14 throws the following error.
Exception in thread "Root Thread" java.lang.NullPointerException
at com.teradata.jdbc.jdbc_4.parcel.ClientAttributesParcel.<init>(ClientAttributesParcel.java:75)
at com.teradata.jdbc.jdbc.GenericLogonController.run(GenericLogonController.java:608)
at com.teradata.jdbc.jdbc_4.TDSession.<init>(TDSession.java:218)
at com.teradata.jdbc.jdk14.JDK14_SQL_Connection.<init>(JDK14_SQL_Connection.java:31)
at com.teradata.jdbc.jdbc.ConnectionFactory.constructSQLConnection(ConnectionFactory.java:106)
at com.teradata.jdbc.jdbc.ConnectionFactory.createConnection(ConnectionFactory.java:179)
at com.teradata.jdbc.jdbc.ConnectionFactory.createConnection(ConnectionFactory.java:169)
at com.teradata.jdbc.TeraDriver.doConnect(TeraDriver.java:232)
at com.teradata.jdbc.TeraDriver.connect(TeraDriver.java:158)
at java.sql.DriverManager.getConnection(DriverManager.java:583)
at java.sql.DriverManager.getConnection(DriverManager.java:187)
at TDTest.requestPriceDetails(TDTest:12)
The connection code is:
create or replace and compile java source named "TDTest" as
// Required class libraries.
import java.sql.*;
import oracle.jdbc.driver.*;
import oracle.aurora.util.*;
import com.teradata.jdbc.*;
public class TDTest {
public static int requestPriceDetails(String anchor, Integer rc, Integer sg, String upc, Integer req_id) throws SQLException {
com.teradata.jdbc.TeraDriver td = new com.teradata.jdbc.TeraDriver();
String tdConnectionString = "jdbc:teradata://tddev1cop1.ngco.com";
Connection tdConn = DriverManager.getConnection(tdConnectionString, "user", "password");
return 0;
}
}
The same code works run using the Oracle JVM on the same server. Is there a parameter that needs to be passed in this JVM?
Chris