2
votes

I am having problems connecting to informix server on a different machine with common .net driver of informix. When I run testconn40_32 it fails with error 08001. What is odd is the host says it's listening on port specified.

The sqlhosts file in host has a line specifying drda connectivity like this:

dr_informix1210 drsoctcp localhost dr_informix1210

I also have a DBSERVERALIASES name specified for that host in onconfig file at the host: DBSERVERALIASES dr_informix1210, lo_informix1210

I've also set all the environment variables including PATH, INFORMIXDIR, INFORMIXSERVER, ONCONFIG and INFORMIXSQLHOSTS.

My services file has a line for that service like this:

dr_informix1210    9089/tcp

I've added a rule to allow connections on that port to the firewall

My hosts file in /etc/hosts also lists the server like this:

127.0.0.1     localhost

and my connection string is the following: Database=sigac_historico;Server=(ip adress:port);UserID=(userid);Password=(password)

So I want to know if I missed any step. I know the error means that somehow drda is not enabled because the host refused the connection. The host runs Ubuntu and my program is made in .NET, running from windows.

I also would mention if I do a telnet to that server it throws an error saying connection can't be opened.

One more question: I see there is a different product by IBM called DB2, ¿is this the only product that supports ADO.NET? Currently I'm trying to connecto to Informix Server

Thanks.

1
if your server sqlhosts file is configured to only listen on localhost then the informix intance will not accept connections coming from other servers.Luís Marques
As @Luís mentioned above, try replacing the localhost with your host external network interface IP address. If your client application (testconn40_32) is also running in the same host then it could be a different issue. Informix does support ADO.NET and it should work.Pradeep Natarajan
@PradeepNatarajan I'll indeed try it, my client application is running on a different machine, so hopefully its the answer I was looking for.gerardo flores

1 Answers

2
votes

To add to what Pradeep said, you can also put "*hostname" in the 3rd column of the SQLHOSTS file (server side) so it will spawn listeners an all network interfaces (real if, localhost, etc).

In relation to the client, yes IBM has a big think call DB2 (will I try to avoid as much as I can ;)

To connect an Informix database from .Net you have two options: 1. the IBM Data Server Client (which is what you currently have) that connects to a DRDA aliases 2. the Informix .Net Provider (included in 'Informix CSDK')

The later is the "native/classic" .Net Provider, uses the standard SQLI protocol (similar to all Informix clients) and supports more Informix features than the DRDA one but, currently, lacks some 'new' .Net features (stuff like EF/Entity Model).

Have a look at Informix Developers Handbook it explains both providers with some good samples of how to use them.