Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

SQLException  RSS feed

Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ...
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.
I execute:
java getIfxMetaData 1533 maq website informix pass
hosts =
port = 1533
dbname= maq
server= website
userid= informix
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.
Thank you
My codes are as below:-
Begin of code>>

[ Edited by Dave to format code ]
[ January 06, 2003: Message edited by: David O'Meara ]
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My first guess would be to check the URL for the JDBC connection: different DBs (and possibly different drivers) seem to require different formats, and I've gotten burned by this particular problem before.
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)
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey fellow Informix user...
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?
Nothing? Or something? Like this tiny ad:
Download Free Java APIs to Work with Office Files and PDF
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!