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);
    }


======================================================================================
bfanisAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gheistCommented:
You have to explicitly enter connection option in onconfig:

NETTYPE soctcp,1,200,net

I doubt USEV5SERVER option is of any help.
Check connection using SquirrelSQL or some other JDBC front.

Catching overly general exception is not purpose of try/catch construct, not I see any possibility to loop in your code.

You have to use Type 4 v3 driver only Type 2 versions have serious issues.

There is demo1 test application that allows you to check connection to Informix databases. They should run in well-configured informix environment with INFORMIXDIR, sqlhosts, correct CLASSPATH etc.
0
bfanisAuthor Commented:
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
0
gheistCommented:
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.
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

bfanisAuthor Commented:
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  ?  
0
gheistCommented:
It could be some sort of network inspection in the middle. Web accelerator or something like that.
If you have SSH server running on AIX you may try forwarding local port to connect to Informix port and use unaltered connection to confirm network filter is guilty.
Another way is using tcpdump on AIX and wireshark on windows to see if packets are sent/received cleanly.

Network inspection may mean antivirus gateway, web accelerator, transparent proxy and God knows what else.
Does telnet S s2 work ??? i.e service name resolution...

Port is not used normally, thus it may trigger IDS
http://seifried.org/security/ports/index.php?port_number=1542
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bfanisAuthor Commented:
i added the @ ip of the client machine in the /etc/hosts of the informix server , it works .


0
gheistCommented:
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)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Databases

From novice to tech pro — start learning today.