Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

java app(testing Teradata connectivity) doesn't work

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I installed Teradata DB on Win(Demo version).
I can view Teradata objects through WinDDI utility.
Also I was able to write java app which connects to Teradata Database and retrieves some records: SELECT * FROM Reatailer.Region
I used jdbc to odbc bridge using sun.jdbc.odbc.JdbcOdbcDriver as jdbc driver
When I replaces
driver to com.ncr.teradata.TeraDriver
it fails on
Class.forName("com.ncr.teradata.TeraDriver");
Connection c = DriverManager.getConnection(url, name, pass);
where url is
String url = "jdbc:teradata://localhost:7060/localhost"
I playde with several different combinations, replacing localhost to my actual machine name, ading TMODE parameter, etc. but it didn't help
My jserver and all Teardata services are up and running
The error I have:

java.sql.SQLException: [NCR][Teradata CLIv2] : Failed while retrieving default
ransaction mode
at com.ncr.teradata.ComUtil.ThrowExcp(Unknown Source)
at com.ncr.teradata.TeraDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager.java:457)
at java.sql.DriverManager.getConnection(DriverManager.java:137)
at JDBCTest.main(JDBCTest.java:32)

It is error 224 which corresponds to
Check the host file entry.
I did testcon.exe and got almost the same error:
Connection to demo1099 failed
224 : MOSI: ER_HOST (117): DBC name not found - possible HOSTS file problem.
I tried to chanhe /etc/host file but it didn't help either.
Everything running on WinNT
Any idea how to fix it?
 
Hi,
CLI requires the IP aliases to end in COP1. this means since you are connecting to localhost you would need a entry like....

127.0.0.1 localhost localhostcop1

However COP targets are limited to 8 characters therefore the above entry would be not located either. since localhost would be truncated to 'localhos'cop1 and it wouldn't locate in the host file.


This why typically we create an entry which says.....

127.0.0.1 localhost dbccop1 democop1

and then you connenct to 'dbc' or 'demo'.

I think the reason this works with the JDBC to ODBC bridge is the ODBC driver doesn't use CLI and therefore doesn't have these COP1 requirements.

the Demo instalation should have created a couple default COP aliases for the demo applications to use. If you could use one of them you application should work.


Hope this helps.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top