Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import sys
- from ibmdbpy import IdaDataBase
- os.environ['CLASSPATH'] = "./lib/db2jcc.jar"
- print ('CLASSPATH: ', os.environ['CLASSPATH'])
- print(os.environ['CLASSPATH'])
- print(sys.platform)
- #Enter the values for you database connection, please replace them with actual values
- dsn_database = "xxx"
- dsn_hostname = "xxxx"
- dsn_port = "50000"
- dsn_uid = "xxx"
- dsn_pwd = "xxx"
- connection_string='jdbc:db2://'+dsn_hostname+':'+dsn_port+'/'+dsn_database+':user='+dsn_uid+';password='+dsn_pwd+";"
- print(connection_string)
- # connect to DB
- idadb=IdaDataBase(dsn=connection_string)
- # print if table is existing in DB. TRUE stands for table existing.
- print (idadb.exists_table("dash100907.cms"))
- Traceback (most recent call last):
- File "../scripts/testing.py", line 24, in <module>
- idadb=IdaDataBase(dsn=connection_string)
- File "C:Python36-32libsite-packagesibmdbpybase.py", line 245, in __init__
- jarpath = jarpath.split(':')[1].replace('\', '/') # get rid of windows style formatting
- IndexError: list index out of range
Add Comment
Please, Sign In to add comment