How to use the python connect informix database?

3,153 views
Skip to first unread message

和泉小夜

unread,
Oct 14, 2015, 1:17:38 AM10/14/15
to ibm_db
jdbc is:


python:
ibm_db.connect("DATABASE=gbaseserver;HOSTNAME=192.168.1.150;PORT=9088;PROTOCOL=drsoctcp;UID=informix;PWD=informix;", "informix", "informix")

Exception: [IBM][CLI Driver] SQL1013N  The database alias name or database name "" could not be found.  SQLSTATE=42705 SQLCODE=-1013

Roopa Ramanathan

unread,
Oct 14, 2015, 1:33:04 AM10/14/15
to ibm_db
Hi ,

In the connection string please specifiy the protocol as tcpip

Thanks and Regards
Roopa

和泉小夜

unread,
Oct 14, 2015, 1:52:49 AM10/14/15
to ibm_db
ibm_db.connect("DATABASE=gbaseserver;HOSTNAME=192.168.1.150;PORT=9088;PROTOCOL=TCPIP;UID=informix;PWD=informix;", "informix", "informix")

sorry..

和泉小夜

unread,
Oct 14, 2015, 1:52:50 AM10/14/15
to ibm_db
sorry.
ibm_db.connect("DATABASE=gbaseserver;HOSTNAME=192.168.1.150;PORT=9088;PROTOCOL=TCPIP;UID=informix;PWD=informix;", "informix", "informix")


Exception: [IBM][CLI Driver] SQL30081N  A communication error has been detected. Communication protocol being used: "TCP/IP".  Communication API being used: "SOCKETS".  Location where the error was detected: "192.168.1.150".  Communication function detecting the error: "recv".  Protocol specific error code(s): "*", "*", "0".  SQLSTATE=08001 SQLCODE=-30081




2015年10月14日水曜日 13時33分04秒 UTC+8 Roopa Ramanathan:

Roopa Ramanathan

unread,
Oct 14, 2015, 2:00:51 AM10/14/15
to ibm_db
Hi,

This error might be because  Informix DRDA port is not enabled. To configure Informix drda port please refer to the below link

http://www-01.ibm.com/support/knowledgecenter/SSGU8G_11.50.0/com.ibm.admin.doc/ids_admin_0207.htm

Thanks and Regards
Roopa

roopa.ra...@in.ibm.com

unread,
Oct 15, 2015, 11:07:59 PM10/15/15
to ibm_db
Hi,

Were you able to connect to Informix successfully. Please let us know if are still facing any issues.

Thanks and Regards
Roopa

Florian Apolloner

unread,
Nov 11, 2015, 12:29:17 AM11/11/15
to ibm_db
FWIW, you can set username and password to "" since you already supplied it via the DSN

Cheers,
Florian

jay fegade

unread,
Apr 26, 2016, 6:36:50 AM4/26/16
to ibm_db
facing same issue


bash-4.2# cat sqlhosts.ol_informix1170
ol_informix1170 onsoctcp localhost ol_informix1170
ol_informix1170_test1 drsoctcp localhost tinformix
dr_informix1170 drsoctcp localhost dr_informix1170
ol_informix1170_test onsoctcp stap5aix2 1526


but getting following error


>>> conn=ibm_db.connect("DATABASE=ol_informix1170_test1;HOSTNAME=stap5aix2;PORT=9502;PROTOCOL=TCPIP;UID=user1;PWD=Password1", "", "")

Traceback (most recent call last):
  File "<pyshell#43>", line 1, in <module>
    conn=ibm_db.connect("DATABASE=ol_informix1170_test1;HOSTNAME=stap5aix2;PORT=9502;PROTOCOL=TCPIP;UID=user1;PWD=Password1", "", "")
Exception: [IBM][CLI Driver] SQL30081N  A communication error has been detected. Communication protocol being used: "TCP/IP".  Communication API being used: "SOCKETS".  Location where the error was detected: "10.10.96.158".  Communication function detecting the error: "connect".  Protocol specific error code(s): "10061", "*", "*".  SQLSTATE=08001
 SQLCODE=-30081

Amarnath N Reddy

unread,
Apr 26, 2016, 9:11:30 AM4/26/16
to ibm...@googlegroups.com

Hello Jay,

Could you check server instance is up and on which port it is listening. You should configure to use same port. It seems like your server drda listener port is not started. please make sure you are listening correctly on drda port.

-Amar

Inactive hide details for jay fegade ---04/26/2016 04:07:00 PM---facing same issue bash-4.2# cat sqlhosts.ol_informix1170jay fegade ---04/26/2016 04:07:00 PM---facing same issue bash-4.2# cat sqlhosts.ol_informix1170

--
You received this message because you are subscribed to the Google Groups "ibm_db" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
ibm_db+un...@googlegroups.com.
To post to this group, send email to
ibm...@googlegroups.com.
Visit this group at
https://groups.google.com/group/ibm_db.
For more options, visit
https://groups.google.com/d/optout.


Reply all
Reply to author
Forward
0 new messages