Skip to content

Commit

Permalink
Add support for installing clidriver using another URL or artifactory…
Browse files Browse the repository at this point in the history
… URL.
  • Loading branch information
MarcinMaciaszek committed Mar 4, 2022
1 parent 29da898 commit 0dee17e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion IBM_DB/ibm_db/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,10 @@ def _setDllPath():
ibm_db_lib = os.path.join(ibm_db_dir, 'lib')

if not os.path.isdir('clidriver'):
url = 'https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/' + cliFileName
if 'IBM_DB_INSTALLER_URL' in os.environ:
url = os.getenv('IBM_DB_INSTALLER_URL') + cliFileName
else:
url = 'https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/' + cliFileName
sys.stdout.write("Downloading %s\n" % (url))
sys.stdout.flush();
file_stream = BytesIO(request.urlopen(url, context=context).read())
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ pip install ibm_db
```
This will install ibm_db and ibm_db_dbi module.

If you have to use your own URL for clidriver please set environment variable
```
IBM_DB_INSTALLER_URL
```

If you are using python 3.8 or 3.9 on windows and building the source manually, you will need to set dll path of dependent library of clidriver before importing the module as:
```
import os
Expand Down

0 comments on commit 0dee17e

Please # to comment.