From e47bae33a7dbca478f619d2369d6c9913195b1d7 Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Sat, 9 Oct 2010 13:27:40 +0200 Subject: initial cx_Oracle connection up and running --- .gitignore | 1 + README | 2 +- dbconfig.py | 11 +++++++++++ dbtest.py | 8 ++++++++ 4 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 dbconfig.py create mode 100644 dbtest.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0d20b64 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.pyc diff --git a/README b/README index 6f6a2f1..3158515 100644 --- a/README +++ b/README @@ -3,4 +3,4 @@ Ayalon Highway Data Analysis Project Created by Yuval Adam (http://y3xz.com) -Data by Ayalon Highways (http://ayalonhw.co.il/) \ No newline at end of file +Data by Ayalon Highways (http://ayalonhw.co.il/) diff --git a/dbconfig.py b/dbconfig.py new file mode 100644 index 0000000..0dfaccb --- /dev/null +++ b/dbconfig.py @@ -0,0 +1,11 @@ +# databse hostname or IP +HOST = '127.0.0.1' + +# database name (instance id), use XE for express edition +SID = 'XE' + +# databse username +USER = 'user' + +# database password +PASS = 'pass' \ No newline at end of file diff --git a/dbtest.py b/dbtest.py new file mode 100644 index 0000000..45d7e50 --- /dev/null +++ b/dbtest.py @@ -0,0 +1,8 @@ +import cx_Oracle +import dbconfig + +connStr = u'%s/%s@%s' % (dbconfig.USER, dbconfig.PASS, dbconfig.SID) + +conn = cx_Oracle.connect(connStr) + +conn.close() -- cgit v1.3.1