If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Unable to connect to informix server

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-05-08, 07:47
sureshaathirai sureshaathirai is offline
Registered User
 
Join Date: Aug 2008
Posts: 1
Unable to connect to informix server

Hi,

My informix server is running in UNIX machine ( sabik).
I am try to connect with informix server from client machine (Unix) using following java code.

url ="jdbc:informix-sqli://sabik:1542/netballs_client:INFORMIXSERVER=sabik_940"
Connection con=DriverManager.getConnection(url, "schidha","january1@");

I am getting error,

java.sql.SQLException: com.informix.asf.IfxASFException: Attempt to connect to database server failed.


Whether i have to add the IP address of informix server into client machine (Obelix) in somewhere?

Please can you help me to solve this issue

Thanks

Suresh C

Last edited by sureshaathirai; 08-05-08 at 08:00.
Reply With Quote
  #2 (permalink)  
Old 08-05-08, 08:36
ceinma ceinma is offline
Registered User
 
Join Date: Apr 2007
Location: Jundiai / SP - Brasil
Posts: 311
Post

I never worked with JDBC (i hate Java) , but...
To connect to IDS you need to configure at least 4 things:
1) dbservername (=sabik_940)
2) protocol (default onsoctcp to JDBC )
3) hostname ( = sabik )
4) TCP portnumber (= 1542)

To make sure you can access the database execute this tests, on the command line:
1) ping the server by name to discover if the name are resolved by DNS: ping sabik
2) execute a telnet on the port of database: telnet sabik 1542
the connection must be accept (to close the conection press "CONTROL+[" )
3) make sure the database name is "netballs_client" and the user have GRANT CONNECT
4) if all this work well, get the error number with some this functions:
Quote:
v getMessage()
Returns a description of the error
SQLException inherits this method from the java.util.Throwable class.
v getErrorCode()
Returns an integer value that corresponds to the Informix database server or
IBM Informix JDBC Driver error code
v getSQLState()
Returns a string that describes the SQLSTATE value
The string follows the X/Open SQLSTATE conventions.
look for more information on the JDBC of CSDK manual:
http://publib.boulder.ibm.com/infoce...g.doc/jdbc.htm
__________________
________________________________________
César Inacio Martins
Jundiai / SP - Brasil
http://www.imartins.com.br/informix - em Português
http://www.imartins.com.br/informix - English (translated by Google).
________________________________________
Reply With Quote
  #3 (permalink)  
Old 08-05-08, 08:39
ceinma ceinma is offline
Registered User
 
Join Date: Apr 2007
Location: Jundiai / SP - Brasil
Posts: 311
I forgot..

make sure your DB server name is sabik_940 and on side of the server if it are configured with the same hostnam/protocol/port on the sqlhosts.
__________________
________________________________________
César Inacio Martins
Jundiai / SP - Brasil
http://www.imartins.com.br/informix - em Português
http://www.imartins.com.br/informix - English (translated by Google).
________________________________________
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On