Link to home
Start Free TrialLog in
Avatar of bfanis
bfanis

asked on

jdbc with informix 5

hi,

i am trying to connect to an informix database Version 5.06 with jdbc, the DriverManager.getConnection instruction loops up and returns nothing.
i tried the same connection in a server in my local network and the connection was successful, but when i try to connect to this  server from a distant machine, i get the problem.
telnet from the distant machine to this server works (using informix service port )
what can be the problem ... is there a missing parameter in the connection URL  ?

thx in advance
======================================================================================
  try {
      Class.forName("com.informix.jdbc.IfxDriver").newInstance();
      conn = DriverManager.getConnection("jdbc:informix-sqli://128.4.2.1:1542/ogcc:INFORMIXSERVER=ONLINE;IFXHOST=develop;USEV5SERVER=1", "informix", "informix");
      this.connected = true;
    }
    catch (Exception e) {
      System.out.println(e);
    }


======================================================================================
SOLUTION
Avatar of gheist
gheist
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bfanis
bfanis

ASKER

hi gheist ,
USEV5SERVER is mandatory as i read in the ibm jdbc developer guide, when i don't use this option the connection on the server doesn't work.

jbdc is type 4 driver, isn't it ?

the problem is that i'm connecting to the same database server,  in the server local network it works, but from a distant machine it doesn't.
in the sqlhosts file i got this line :
ONLINE       ontlitcp       develop       s2       (s2 =1542 in etc/services)

"NETTYPE soctcp,1,200,net"    ?i haven't understood what this command is for
1) if you use tlitcp protocol, soctcp detects previous releases better

2) NO. Type 2 JDBC loads native libraries.

3) Make sure SQLHOSTS on client specify same protocol as sqlhosts file on server.
Can you ping machine "develop" from client? Does it resolve s2 in drivers\etc\services ???

4) It is to be put in etc/onconfig on your informix server to supply only required protocol over connection.
Avatar of bfanis

ASKER

there is no etc/onconfig on the server
please explain more 1)

the problem is that i'm connecting to the same database server  S ,   in the local network  from machine M1 it works, but from a distant machine  M2 it doesn't.

"telnet S 1542"  works
"ping S"  works



it can be a network problem  ?  
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bfanis

ASKER

i added the @ ip of the client machine in the /etc/hosts of the informix server , it works .


Umm... The real fix is fixing your DNS so that reverse DNS lookups happen on AIX at all (that has to be fixed outside AIX) and that those lookups do happen immediatly - i.e AIX gets caching BIND installation by converting resolv.conf into forwarders in named.boot or named.conf ( pass this to thoes taking care of your DNS server and AIXX system if in doubt)