• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

SQLException

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 192.168.0.5 1533 maq website informix pass
where:
hosts = 192.168.0.5
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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
There's a city wid manhunt for this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic