'How to connect to an Intersys cache database in Python

I'm using PyCharm and I'm trying to connect to a database which is connected via the Intersys cache. In many places online it is stated that I need to connect with the intersys.pythonbind2 module.

I don't have this module in PyCharm and cannot find where to download it.

I looked through many pages, but with no success. I know how to connect for example to Microsoft SQL Server, but here it looks like the connection is totally different.

How can I do it?



Solution 1:[1]

In the end, I created the data source in ODBC with the Intersys driver and then connected to it using pyodbc. Now I'm able to retrieve data from the database.

Solution 2:[2]

You can check the Try IRIS site which gives you your online sandbox with IRIS (the next version of Caché) with examples of a connection from Python to InterSystems IRIS.

Solution 3:[3]

I used jaydebeapi and dbutils for connection pool

   self.pool = PooledDB(
        creator= jaydebeapi,
        maxconnections=pool_size,
        mincached=pool_size,
        blocking=False,
        
        jclassname=self._DRIVER_PKG, #com.intersys.jdbc.CacheDriver
        url=self._CONNECTION_STR, #'jdbc:Cache://' + host+ ':' + str(port) + '/' + database
        driver_args= [user, password],
        jars = self._DRIVER_PATH, #esources/CacheDB.jar
    )

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Peter Mortensen
Solution 2 Peter Mortensen
Solution 3 jesus cabrera