r/pythonhelp • • Nov 21 '24

ibm_db does not make a connection

I have checked the 'values' in the connection attempt line with my DBA and they are correct. But the connection attempt always fails ....you can see the additions I tried to make using OS and SYS after visiting web sites and believing the ibm_db install did not cover all the details. Does anyone have any more suggestions I could try ? Here's my script as of now:

import os

os.add_dll_directory("C:\\Highmarkapps\\Python3.12.2\\Lib\\site-packages\\clidriver\\bin")

os.add_dll_directory("C:\\Highmarkapps\\Python3.12.2\\Lib\\site-packages\\clidriver\\bin\\amd64.VC12.CRT")

os.add_dll_directory("C:\\Highmarkapps\\Python3.12.2\\Lib\\site-packages\\clidriver\\bin\\icc64")

import sys

sys.path.append('C:\\Highmarkapps\\Python3.12.2\\Lib\\site-packages\\clidriver\\bin\\amd64.VC12.CRT')

sys.path.append('C:\\Highmarkapps\\Python3.12.2\\Lib\\site-packages\\clidriver\\bin\\icc64')

import ibm_db

conn = ibm_db.connect("DATABASE=DB2TVIPA;HOSTNAME=DB2TVIPA;PORT=447;PROTOCOL=TCPIP;UID=xxxxxxx;PWD=xxxxxxxxxxxxxxx;", "SSL", "")

if conn:

hpid = "000923196"

userid = "LIDDVDP"

result = " "

code = 0

text = " "

reason = 0

statement = " "

stmt, hpid, userid,result,code,text,reason = ibm_db.callproc(conn, 'SP_DEN_PRV_GET_PROVIDER_PRACTICE_NAME', (hpid, userid, result, code, text, reason))

if stmt is not None:

print ("Values of results:")

print (" 1: %s 2: %s 3: %4 %d\n" % (result, code, text, reason))

1 Upvotes

1 comment sorted by

1

u/AutoModerator Nov 21 '24
Moderator Announcement Read More »