Connecting to Splice Machine with Python via JDBC

This topic shows you how to connect to a Splice Machine database using our JDBC driver with Python, using these steps:

  1. Install the JayDeBeApi python library

     $ pip install JayDeBeApi
  2. Start the Python interpreter

    $ python
  3. Connect to a running instance of Splice Machine

    >>> import jaydebeapi
    >>> conn = jaydebeapi.connect("com.splicemachine.db.jdbc.ClientDriver",
    {'user': "yourUserId", 'password': "yourPassword", 'ssl': "basic"},
    >>> curs = conn.cursor()
    >>> curs.execute('select count(1) from sys.systables')
    >>> n = curs.fetchall()
    >>> n
    [(< object at 0x11fd61ad0>,)]
    >>> int(n[0][0].value)