I have seen the Cache Python binding documentation and would like to know if it's also possible with IRIS so I can write data and also read/get it from the DB? The cachesys folder does not contain any python libraries.
You can definitely compile and install cache-python binding module on x86-64 machines. I have done this on Ubuntu and it produced (pythonbind3-1.0-py3.6-linux-x86_64.egg). I am not sure I understand why it cannot be installed on IRIS x86-64bit platform. If you install python binding on IRIS I will be also interested in testing my CacheORM object-relational mapper.
Here is a quick example program I wrote a couple of months ago. This uses JDBC and the JayDeBeapi library others have mentioned. Note the Credentials import provides a set of login credentials in the following format.
def get_database_connection(inpDBInstance): IRIS_JARFILE = "/home/ritaylor/InterSystemsJDBC/intersystems-jdbc-3.2.0.jar" IRIS_DRIVER = "com.intersystems.jdbc.IRISDriver" AA_JARFILE = "/home/ritaylor/Downloads/AtScale/hive-jdbc-uber-2.6.5.0-292.jar" AA_DRIVER = "org.apache.hive.jdbc.HiveDriver" # note connecting to two data sources in the same program requires that you # reference the paths to BOTH jar files in a list in every call. Otherwise the # second connection attempt will fail. It appears that the paths only get # added once within a process. JDBC_JARFILES = [IRIS_JARFILE,AA_JARFILE]
# Database settings - this should be in a config file somewhere if (inpDBInstance == "local"): dbConn = jaydebeapi.connect(IRIS_DRIVER, "jdbc:IRIS://18.119.2.28:1972/USER", credentials.LocalCreds, JDBC_JARFILES) else: dbConn = None
Components Installed by Setup Type: IRIS, Caché
Unfortunately, Perl/Python Binding supported only on the x86-32 bit platform, but IRIS is only supported for x86-64.
Thanks. I assume I could still connect with something like this if I get it to work? https://pypi.org/project/JayDeBeApi/#usage
REST, JDBC - of course.
or leveraging pyspark, as explained in this article
Thanks, I will look into this, for now I'm getting the desired results with REST and CURL.
You can definitely compile and install cache-python binding module on x86-64 machines. I have done this on Ubuntu and it produced (pythonbind3-1.0-py3.6-linux-x86_64.egg). I am not sure I understand why it cannot be installed on IRIS x86-64bit platform. If you install python binding on IRIS I will be also interested in testing my CacheORM object-relational mapper.
Here is a quick example program I wrote a couple of months ago. This uses JDBC and the JayDeBeapi library others have mentioned. Note the Credentials import provides a set of login credentials in the following format.
LocalCreds = {"user":"SuperUser", "password":"SYS"}
Here is the code:
import credentials
IRIS_JARFILE = "/home/ritaylor/InterSystemsJDBC/intersystems-jdbc-3.2.0.jar"
IRIS_DRIVER = "com.intersystems.jdbc.IRISDriver"
AA_JARFILE = "/home/ritaylor/Downloads/AtScale/hive-jdbc-uber-2.6.5.0-292.jar"
AA_DRIVER = "org.apache.hive.jdbc.HiveDriver"
# note connecting to two data sources in the same program requires that you
# reference the paths to BOTH jar files in a list in every call. Otherwise the
# second connection attempt will fail. It appears that the paths only get
# added once within a process.
JDBC_JARFILES = [IRIS_JARFILE,AA_JARFILE]
if (inpDBInstance == "local"):
dbConn = jaydebeapi.connect(IRIS_DRIVER,
"jdbc:IRIS://18.119.2.28:1972/USER",
credentials.LocalCreds,
JDBC_JARFILES)
else:
dbConn = None
return dbConn
resultSet = None
cursor = dbConn.cursor()
cursor.execute(inpQuery)
resultSet = cursor.fetchall()
if (resultSet != None):
for row in resultSet:
print(row)
else:
print("Input result set is empty")
Social networks
InterSystems resources
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue