Search code examples
javawebsphereteradatajndiwebsphere-liberty

Teradata JNDI DataSource WAS Liberty


I have this JNDI configured. But I'm getting the next exception. I can not set the DSName property

<!-- Teradata -->
<dataSource
    id="com.teradata.jdbc.TeraConnectionPoolDataSource"
    jndiName="jdbc/teradata">
    <jdbcDriver libraryRef="TeradataLib" />
    <properties databaseName="----" serverName="----" user="-----" password="-----"/>
</dataSource>

<library id="TeradataLib">
    <file
        name="----/TeraJDBC/terajdbc4.jar" />
</library>

And the ex is:

org.springframework.jdbc.support.MetaDataAccessException: Could not get Connection for extracting meta-data; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: [Teradata JDBC Driver] [TeraJDBC 16.20.00.10] [Error 606] [SQLState HY000] A valid DSName property must be specified for the DataSource, to provide the Teradata Database hostname. DSRA0010E: Estado SQL = HY000, Código de error = 606
.....
Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: [Teradata JDBC Driver] [TeraJDBC 16.20.00.10] [Error 606] [SQLState HY000] A valid DSName property must be specified for the DataSource, to provide the Teradata Database hostname. DSRA0010E: Estado SQL = HY000, Código de error = 606
.....
Caused by: java.sql.SQLException: [Teradata JDBC Driver] [TeraJDBC 16.20.00.10] [Error 606] [SQLState HY000] A valid DSName property must be specified for the DataSource, to provide the Teradata Database hostname. DSRA0010E: Estado SQL = HY000, Código de error = 606
.....
java.sql.SQLException: [Teradata JDBC Driver] [TeraJDBC 16.20.00.10] [Error 606] [SQLState HY000] A valid DSName property must be specified for the DataSource, to provide the Teradata Database hostname. DSRA0010E: Estado SQL = HY000, Código de error = 606

@AlexMotley

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.orm.jpa.JpaVendorAdapter]: Factory method 'jpaVendorAdapter' threw exception; nested exception is java.lang.NoClassDefFoundError: Could not initialize class com.teradata.tdgss.jtdgss.TdgssManager

Thanks.


Solution

  • I have found the solution, I leave it here in case someone else has a similar problem:

    <!-- Teradata -->
    <dataSource
        id="com.teradata.jdbc.TeraConnectionPoolDataSource"
        jndiName="jdbc/teradata">
        <jdbcDriver libraryRef="TeradataLib" javax.sql.ConnectionPoolDataSource="com.teradata.jdbc.TeraConnectionPoolDataSource"/>
        <properties serverName="IP" user="user" password="password" DSName="IP"/>
    </dataSource>
    
    <library id="TeradataLib">
        <file
            name="../TeraJDBC/terajdbc4.jar" />
        <file name= "../TeraJDBC/tdgssconfig.jar" />
    </library>
    

    Many thanks to @AlexMotley who has helped me with this problem.