Hi!
I grabbed some pieces of code from a previous project. In this project I could connect to Cache 2018.
PS: I didn't test this mashup.
import irisnative
import jaydebeapi
import pandas as pd
def create_conn(type, host, port, namespace, user, password):
if type == "cache":
url = f"jdbc:Cache://{host}:{port}/{namespace}"
driver = "com.intersys.jdbc.CacheDriver"
jarfile = "C:/InterSystems/Cache2018/dev/java/lib/JDK18/cache-jdbc-2.0.0.jar"
conn = jaydebeapi.connect(driver, url, [user, password], jarfile)
else:
conn = irisnative.createConnection(host, port, namespace, user, password, sharedmemory = True)
return conn
conn = create_conn("cache", "x.x.x.x", "56772", "namespace", "user", "password")
sql = "select ..."
df = pd.read_sql(sql, conn)
display(df)HTH,
José
- Log in to post comments