Jython & Lucid

Install jython

 brew install jython

or whatever package installer your machine has.
Install pip

 sudo easy_install pip

Install Virtualenv

 sudo pip install virtualenv

Create new environment

virtualenv -p /usr/local/bin/jython <your-project-name>

Activate virtualenv


cd <your-project-name>

source bin/activate (I use zsch & this works for me)

Install jip

 ./bin/pip jip

Run a query


from com.ziclix.python.sql import zxJDBC

db = zxJDBC.connect("jdbc:luciddb:http://localhost:8034", "sa", None, "org.luciddb.jdbc.LucidDbClientDriver")

cursor = db.cursor()

cursor.execute("select * from reports.watching where event_id = '757670'")

for row in cursor:
print row

cursor.close()
db.close()

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s