I have a requirement to enable a failover/secondary database for a DB2 database hosted on a Linux Server for a python application using the IBM_DB package.
With a JDBC driver, you can easily the following parameters to the connection string:
clientRerouteAlternatePortNumber=port#
clientRerouteAlternateServerName=servername
enableSeamlessFailover=1
Since the IBM_DB package uses a CLI driver, these parameters wouldn't be the same. I found the following parameters through the IBM documentation, which are: https://www.ibm.com/support/knowledgecenter/SSEPGG_11.5.0/com.ibm.db2.luw.apdv.embed.doc/doc/c0060428.html
enableAlternateServerListFirstConnect
alternateserverlist
maxAcrRetries
However, through the instructions of how to include it in the link below, it seems like it is only possible to include them in this DB file: db2dsdriver.cfg
I know a lot of these parameters are configurable in the connection string, and I wanted to know if it was possible to include these particular parameters in the connection string. Is there any documentation/verification that something like this can work:
import ibm_db_dbi
connect = ibm_db_dbi.connect("DATABASE=whatever; \
HOSTNAME=whatever; \
PORT=whatever; \
PROTOCOL=TCPIP; \
UID=whatever; \
PWD=whatever; \
CURRENTSCHEMA=whatever;\
AUTHENTICATION=SERVER_ENCRYPT;\
ClientEncAlg=2;\
enableAlternateServerListFirstConnect=True;\
alternateserverlist=server1,port1,server2,port2;\
maxAcrRetries=2", "", "")
Thank you for any help.