Using Teradata JDBC driver with WebSphere Application Server

Connectivity
Connectivity covers the mechanisms for connecting to the Teradata Database, including driver connectivity via JDBC or ODBC.
Teradata Employee

Using Teradata JDBC driver with WebSphere Application Server

The Teradata JDBC Driver Connection Pooling facility can greatly improve application performance. The steps used to enable it for the Teradata JDBC Driver will vary with the application server being used.

Tags (1)
6 REPLIES
Enthusiast

Re: Using Teradata JDBC driver with WebSphere Application Server

A very helpful article,

can you explain what's a Connection Pool ?
I've read lot of things on it and I'm a little bit surprised by the description of Connection pool because it seems
that it also cuts down on the amount of time a user must wait to establish a connection to the database because the connection is already etablished.
Does it mean that when I close my connection with con.close(); method , the session is always alive (or iddle) in Teradata ?

By the way, what's the benefit of the pool connection ?

Thanks
Teradata Employee

Re: Using Teradata JDBC driver with WebSphere Application Server

> Does it mean that when I close my connection with con.close(); method , the session is always alive (or idle) in Teradata ?

Yes, exactly.

> what's the benefit of the pool connection ?

The primary purpose of a connection pool is to limit, manage, control, and reuse database connections.

A secondary purpose is as you said, "it also cuts down on the amount of time a user must wait to establish a connection to the database because the connection is already etablished."
Enthusiast

Re: Using Teradata JDBC driver with WebSphere Application Server

Probleme JDBC and websphere datasource.
My JDBC driver is "Teradata JDBC Driver 13.10.00.03".
It has been implemented on a websphere server (websphere 6.1). A datasource (jdbc/dimdti_teradata) has been created and a connexion have been made throught the websphere console with success.

BUT

When we tried to use this datasource throught a servlet with this syntax :
DataSource ds = (DataSource) ctx.lookup("jdbc/dimdti_teradata");
con = ds.getConnection();
I got this error (seel below).
It seems that it's a datasource matter. I can reproduce this error if I use this method
con = ds.getConnection(login, password);
and I volontary put login and password to null string.

So here is my situation : If I test datasource from websphere console it's OK, if I use this datasource from a servlet it
doesnt work.

Can anyone help me ?

Thanks a lot
Establishing connection...
*** SQLException caught ***
Message: [Teradata JDBC Driver] [TeraJDBC 13.10.00.03] [Error 1032] [SQLState HY000] Single Sign-On NOT supported for

Mechanism TD2.DSRA0010E: SQL State = HY000, Error Code = 1,032
SQLState: HY000
ErrorCode: 1032
java.sql.SQLException: [Teradata JDBC Driver] [TeraJDBC 13.10.00.03] [Error 1032] [SQLState HY000] Single Sign-On NOT

supported for Mechanism TD2.DSRA0010E: SQL State = HY000, Error Code = 1,032
at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDriverJDBCException(ErrorFactory.java:92)
at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDriverJDBCException(ErrorFactory.java:67)
at com.teradata.jdbc.jdbc.GenericTeraEncrypt.initEncrypt(GenericTeraEncrypt.java:221)
at com.teradata.jdbc.jdbc.GenericTeraEncrypt.(GenericTeraEncrypt.java:135)
at com.teradata.jdbc.jdbc.GenericAssignState.action(GenericAssignState.java:83)
at com.teradata.jdbc.jdbc.GenericLogonController.run(GenericLogonController.java:120)
at com.teradata.jdbc.jdbc_4.TDSession.(TDSession.java:201)
at com.teradata.jdbc.jdbc_3.ifjdbc_4.TeraLocalConnection.(TeraLocalConnection.java:99)
at com.teradata.jdbc.jdbc.ConnectionFactory.createConnection(ConnectionFactory.java:58)
at com.teradata.jdbc.TeraDataSourceBase.createNewConnection(TeraDataSourceBase.java:757)
at com.teradata.jdbc.TeraPooledConnection.getConnection(TeraPooledConnection.java:120)
at com.ibm.ws.rsadapter.spi.WSRdbDataSource.getConnection(WSRdbDataSource.java:1820)
at

com.ibm.ws.rsadapter.spi.WSManagedConnectionFactoryImpl.createManagedConnection(WSManagedConnectionFactoryImpl.java:1267)
at com.ibm.ejs.j2c.FreePool.createManagedConnectionWithMCWrapper(FreePool.java:1990)
at com.ibm.ejs.j2c.FreePool.createOrWaitForConnection(FreePool.java:1662)
at com.ibm.ejs.j2c.PoolManager.reserve(PoolManager.java:2363)
at com.ibm.ejs.j2c.ConnectionManager.allocateMCWrapper(ConnectionManager.java:934)
at com.ibm.ejs.j2c.ConnectionManager.allocateConnection(ConnectionManager.java:610)
at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSource.java:449)
at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSource.java:418)
at Teraserv3bis.doGet(Teraserv3bis.java:34)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1146)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:592)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:525)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:751)
at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1478)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:126)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:387)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:267)
at

com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture$1.run(AsyncChannelFuture.java:205)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1497)
teraserv1 finished.
Teradata Employee

Re: Using Teradata JDBC driver with WebSphere Application Server

In the document above, please refer to Section 4.2.1 -- "DataSource.
getConnection() vs. DataSource.getConnection(username,password)"

It discusses the error you received, and the solutions.
Enthusiast

Re: Using Teradata JDBC driver with WebSphere Application Server

Thank you for your answer.

I read your article many times and I also read this section.

The fact is my datasource is good, I mean there are no problem with user and password set in the datasource. I've done a connexion test throught the websphere console and my datasource is OK. I'm sure about it.

So why t this error when I use my datasource in a servlet ?
It looks like a problem between websphere and JDBC, it seems that websphere did'nt transmit user and password to the JDBC driver.

I've got the same error if I try to connect to Teradata with jdbc and I volontary set user and password to null string.

I'm really lost with this problem !!!

Thanks for your help anyway
Enthusiast

Re: Using Teradata JDBC driver with WebSphere Application Server

The problem is fixed.

Just setting correct parameters in websphere :
Authentification handle by container