Guest User

Untitled

a guest
Jan 29th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. import os
  2. import sys
  3. from ibmdbpy import IdaDataBase
  4.  
  5. os.environ['CLASSPATH'] = "./lib/db2jcc.jar"
  6. print ('CLASSPATH: ', os.environ['CLASSPATH'])
  7.  
  8. print(os.environ['CLASSPATH'])
  9. print(sys.platform)
  10.  
  11. #Enter the values for you database connection, please replace them with actual values
  12. dsn_database = "xxx"
  13. dsn_hostname = "xxxx"
  14. dsn_port = "50000"
  15. dsn_uid = "xxx"
  16. dsn_pwd = "xxx"
  17. connection_string='jdbc:db2://'+dsn_hostname+':'+dsn_port+'/'+dsn_database+':user='+dsn_uid+';password='+dsn_pwd+";"
  18.  
  19. print(connection_string)
  20. # connect to DB
  21. idadb=IdaDataBase(dsn=connection_string)
  22.  
  23. # print if table is existing in DB. TRUE stands for table existing.
  24. print (idadb.exists_table("dash100907.cms"))
  25.  
  26. Traceback (most recent call last):
  27. File "../scripts/testing.py", line 24, in <module>
  28. idadb=IdaDataBase(dsn=connection_string)
  29. File "C:Python36-32libsite-packagesibmdbpybase.py", line 245, in __init__
  30. jarpath = jarpath.split(':')[1].replace('\', '/') # get rid of windows style formatting
  31. IndexError: list index out of range
Add Comment
Please, Sign In to add comment