I downloaded Informix JDBC driver Type 4 and installed it already. I have written a small program
to test whether I could access to the Informix database using the driver.
java getIfxMetaData 192.168.0.5 1533 maq website informix pass
hosts = 192.168.0.5
port = 1533
pass = pass
I got the error as below:-
ERROR: Attempt to connect to database server website failed.
java.sql.SQLException: Attempt to connect to database server website failed...
The Informix database server is located in the same machine as the JDBC Driver. No idea why this
is happening...will be most grateful if someone could help me out here.
My codes are as below:-
Begin of code>>
[ Edited by Dave to format code ]
[ January 06, 2003: Message edited by: David O'Meara ]
Other ideas (in order of most probable to happen to me):
* the database service isn't running
* somehow I'm misparsing the incoming parameters to build my URL (I did cross-check that in your code: looks fine - but I'd probably still do a System.out to verify it)
Just in case you haven't seen the error explanation from Informix:
Attempt to connect to database server (servername) failed.
The program or application is trying to access another database server but has failed. Note the server name in the current statement.
The desired database server is unavailable, or the network is down or is congested. Ask your DBA and system administrator to verify that the server and network are operational. If the network is congested, use the environment variables INFORMIXCONTIME and INFORMIXCONRETRY to tune connection timing. For information on setting these environment variables, see the Informix Guide to SQL: Reference.
This message appears in Version 6.0 and later versions.
I ran your connection code (main()) against our ifx server and it worked fine.
As Tina suggested, verify that the db server is actually running and that you have the correct ip and port.
Have you tried connecting to it just through an sql editor?