1. Login to TIBCO Data Virtualization server and download csjdbc8.jar file from <TDV installation directory>/apps/jdbc/lib/.
2. Upload the csjdbc8.jar file to the Notebook server and copy it to the notebook installation directory. (generally /opt/notebooks)
3. In the notebook installation directory create a text file and store the password for the TDV user using which user wants to make a TDV connection.
eg. password.txt
4. Open a Python Notebook on the Team Studio server and install the JayDeBeApi package:
>pip install JayDeBeApi
5. Use the following sample code for connection:
----------------------------------------------------------------------
import jaydebeapi
import pandas
os.environ["CLASSPATH"] = "/opt/notebooks/csjdbc8.jar"
with open("/opt/notebooks/password.txt") as passwd_reader:
tdv_pwd = passwd_reader.read().rstrip()
sparkdb_url = "jdbc:compositesw:dbapi@<TDV server IP>:<TDV JDBC port>?unsupportedMode=silent&domain=composite&dataSource=Data&enableFlood=false&traceLevel=all"
with jaydebeapi.connect("cs.jdbc.driver.CompositeDriver", sparkdb_url,
["tsuser", tdv_pwd], "/path/to/csjdbc8.jar") as tdv_conn:
df = pandas.read_sql('select * from "Datasets_S3"."addbatchtestdata.csv"', tdv_conn)
display(df) ----------------------------------------------------------------------