0
votes

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.

1
Why can you not set the DSName property? Datasource properties specified on the properties element will be passed to the JDBC driver.Alex Motley
@AlexMotley I don't know how...German Avalos
Like this: <properties databaseName="----" serverName="----" user="-----" password="-----" DSName="-----" />Alex Motley
@AlexMotley I have already triedGerman Avalos
And you get the same error when you have that set? Or a different error?Alex Motley

1 Answers

0
votes

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.