Teradata JNDI connectivity

Connectivity
Enthusiast

Teradata JNDI connectivity

Hi,

We have teradata12 installed on my machine. I am trying to connect to teradata from a java application. When i try to connect through JDBC, i can connect. But when we try to connect using jndi, i am getting the error as:

Error occured while trying to connect to the database
Invalid JNDI connection stag : [Teradata JDBC Driver] [TeraJDBC 12.00.00.110] [Error 1000] [SQLState 08S01] Login failure for Connection to 10.20.26.212:1025 Wed Dec 02 16:31:58 GMT+05:30 2009 socket cid=5113f0 sess=0 java.net.UnknownHostException: 10.0.6.212:1025 at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)

JNDI is defined as:

stag/type=javax.sql.DataSource
stag/driver=com.teradata.jdbc.TeraDriver
stag/url=jdbc:teradata://10.20.26.212:1025/dbc
stag/user=abc
stag/password=abc123

Please let me know if i am missing any step.

Regards,
Rajiv Gupta
7 REPLIES
Teradata Employee

Re: Teradata JNDI connectivity

Your URL is not correct. It has 2 problems.

stag/url=jdbc:teradata://10.20.26.212:1025/dbc

The first problem is the colon and port number. Do not put a colon and port number after the Teradata Database hostname. The default port number for the Teradata Database is 1025, so that port number does not need to be specified. If your Teradata Database is listening on a non-default port number that is something other than 1025, then use the DBS_PORT= connection parameter to specifiy the Teradata Database port. The DBS_PORT= connection parameter is documented in the Teradata JDBC Driver User Guide.

The second problem is the /dbc at the end of your URL. That is not supported syntax. Are you trying to specify the default database to use? If so, then the DATABASE= connection parameter should be used.

Try this instead:

stag/url=jdbc:teradata://10.20.26.212

Or this, if you want the default database after logon to be set to "dbc":

stag/url=jdbc:teradata://10.20.26.212/DATABASE=dbc

Enthusiast

Re: Teradata JNDI connectivity

thanks a lot, it worked :)

Re: Teradata JNDI connectivity

is there any jdbc driver instead of teradata jdbc? thanks

Teradata Employee

Re: Teradata JNDI connectivity

Please do not add new questions to old forum threads. Please start a new forum thread for a new question.

Regarding your question... Each database vendor offers a JDBC Driver for its own database. Oracle offers a JDBC Driver for the Oracle Database, IBM offers a JDBC Driver for the IBM DB2 database, etc.

The Teradata JDBC Driver is the only supported JDBC Driver for the Teradata Database.

Re: Teradata JNDI connectivity

Hi Team,

I am new to teradata. I am trying to install the tearadata in my laptop for learning. I dont know what to give in the URL for while connecting to the window. If i try to run a quer i am getting the error "Cannot execute sel without a connection".Kindly help me on this

Thanks in advance

Re: Teradata JNDI connectivity

Hi,

Can I run a javascript by calling a teradata stored procedure?

Can anyone please provide a sample example with the connectvity steps , please?

Thanks

Visitor

Re: Teradata JNDI connectivity

Workwd for me to. But is returning error, cant create table or delete. I am loading a large table from MySQL to teradata and need to create the table and truncate. Remember the user has rights to do it at teradata. Please help...