Login Register Actian.com  

Actian Community Forum


Go Back   Actian Community Forums > Development Tools > Application Development using Java, ODBC, .NET, OpenAPI, PHP, etc
 

Reply
 
LinkBack Thread Tools Display Modes
Old 2012-02-10   #1 (permalink)
Junior Member
 
Join Date: Feb 2012
Posts: 6
Default Problem connecting to Ingres using JDBC - connection failed

Hi,

When i try to set up a test JDBC connection to my database I receive the following error:

SQLException: Connection failed.
com.ingres.gcf.util.SqlEx: Connection failed.
at com.ingres.gcf.util.SqlEx.get(Unknown Source)
at com.ingres.gcf.dam.IoBuff.fillBuffer(Unknown Source)
at com.ingres.gcf.dam.IoBuff.next(Unknown Source)
at com.ingres.gcf.dam.InBuff.receive(Unknown Source)
at com.ingres.gcf.dam.MsgIn.<init>(Unknown Source)
at com.ingres.gcf.dam.MsgConn.<init>(Unknown Source)
at com.ingres.gcf.jdbc.DrvConn.connect(Unknown Source)
at com.ingres.gcf.jdbc.DrvConn.<init>(Unknown Source)
at com.ingres.gcf.jdbc.JdbcDrv.connect(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at Connect.main(Connect.java:44)

The following is also output to $II_SYSTEM/ingres/files/errlog.log:
E_GC2811_TL_INVALID_TPDU TL internal error: Received invalid TPDU type 00000040.

E_GC2812_TL_INVALID_CONNCTN TL internal error: Received unknown connection id 0000544C from partner.

E_GC2806_TL_FSM_INP TL internal error: Invalid input event in TL FSM


The connection string that I am using is:
String url="jdbc:ingres://<portnumber>:NV7/<dbname>;uid=ingres;pwd=******";

the jar file that I am using is iijdbc.jar

Any help on this is much appreciated,

Thanks,
Graeme
mooneyg is offline   Reply With Quote
Old 2012-02-10   #2 (permalink)
Ingres Corp
 
Join Date: Nov 2007
Posts: 50
Default

The most likely explanation is that the driver connected to something other than Data Access Server. Verify the host and listen address of the target installation. You can also test connections using the JdbcInfo utility (in the Ingres lib directory):

java JdbcInfo <host> <address>
thogo01 is offline   Reply With Quote
Old 2012-02-10   #3 (permalink)
Ingres Corp
 
Join Date: Mar 2007
Location: On the OpenROAD
Posts: 1,306
Default

Quote:
String url="jdbc:ingres://<portnumber>:NV7/<dbname>;uid=ingres;pwd=******";
Are you really using "<portnumber>:NV7" within the url?
It should be "<host>:<port>". "NV7" is probably the portnumber.
Bodo is offline   Reply With Quote
Old 2012-02-14   #4 (permalink)
Junior Member
 
Join Date: Feb 2012
Posts: 6
Default

Quote:
Originally Posted by thogo01 View Post
The most likely explanation is that the driver connected to something other than Data Access Server. Verify the host and listen address of the target installation. You can also test connections using the JdbcInfo utility (in the Ingres lib directory):

java JdbcInfo <host> <address>
When I try to run this command I am presented with the following error:

Error accessing driver components:
com.ingres.gcf.dam.MsgConn

After googling this error it looks like it may be occurring as I do not have anything set in my CLASSPATH. Other posts mention to have %II_SYSTEM%\ingres\lib\iijdbc.jar set in the classpath. Though %II_SYSTEM%\ingres\lib\ is set in the LD_LIBRARY_PATH. (Not sure if this has any effect)

So at the moment, on my local machine I have a java class that has iijdbc.jar set in its build path.

This is trying to connect to:
"jdbc:ingres://<ip address>:NV7/<dbname>;uid=ingres;pwd=******"
(My apologies I originally said <portnumber> instead of <ip address>)

On the <ip address> machine the iijdbc.jar is not in the classpath.

I will try setting the classpath to see if this resolves the issue.
mooneyg is offline   Reply With Quote
Old 2012-02-14   #5 (permalink)
Ingres Community
 
bilgihan's Avatar
 
Join Date: Aug 2008
Location: Munich, Germany
Posts: 271
Default

How your CLASSPATH looks like?
If not, it should be:
CLASSPATH=$II_SYSTEM/ingres/lib/:$II_SYSTEM/ingres/lib/iijdbc.jar:.

Should you still encounter any error you can enable JDBC tracing

#######Create a file with name: iijdbc.properties
# For test purposes use: java JdbcInfo <host> <address>
# This file has to be in current directory
# use <pfad> to ensure having correct jdbc.log file:
ingres.jdbc.trace.log=iijdbc-trace.log
#
ingres.jdbc.trace.drv=1
ingres.jdbc.trace.timestamp=true
#### End of the file.
bilgihan is offline   Reply With Quote
Old 2012-02-14   #6 (permalink)
Junior Member
 
Join Date: Feb 2012
Posts: 6
Default

Many thanks for all the help guys.

My issue was that the DAS was not up and running. I also set the CLASSPATH to $II_SYSTEM/ingres/lib/iijdbc.jar:.

Much appreciated,
Graeme
mooneyg is offline   Reply With Quote

Reply



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


© 2011 Actian Corporation. All Rights Reserved