Re: [cx-oracle-users] Python and Oracle DB API (cx_oracle)
Brought to you by:
atuining
From: Marco De P. <dep...@gm...> - 2011-06-04 06:48:00
|
cx_Oracle 5.1 is the current version (I suggest you to use that and not not the 4.X) First of all build a minimal script that works at the command line. Only at that point you can build a web version psp means a mod_perl script (Apache settings are OT in this ML) Marco On Sat, Jun 4, 2011 at 4:33 AM, Me <zed...@ya...> wrote: > Hello All > > > I'm newbie to Python, Oracle and Apache 2.2 > > I've installed python 2.7 (ActiveState version), apache 2.2 and Oracle 10g > XE. > > > All of them running in the same machine with XP as a OS. > > > I yet don't have 'mod_python' installed but I am planing to do so later. > > (just using CGI script for time being although for web development i've > read mod_python is the best.) > > > I just download the 'cx_Oracle-4.1.2-win32-10g-py27.exe' from the Oracle > web site which is: > > ( > http://www.oracle.com/technetwork/articles/piotrowski-pythoncore-084049.html > ) > > > the installation went smooth with no problem as the above site walks > through. > > then as site instructed::Create a file ora.psp under APACHE_HOME/htdocs to > see whether the cx_Oracle module is working properly. > > -------------------------------------- > > <% > import cx_Oracle > db = cx_Oracle.connect('username', 'password', '127.0.0.1/XE') > c = db.cursor() > > c.execute('select * from dual') > req.write(c.fetchall()[0][0]) > > db.close() > %> > > I put my username\pass for log in to Oracle as it works with database > after login. > > ------------------------------------ > > i did save the file in notepad and put it in C:\Program Files\Apache > Software Foundation\Apache2.2\htdocs\ora.psp ( i saved as: "ora.psp" to > eliminated the extra extention) > > > when i go to url: ( http://127.0.0.1/ora.psp ) it just shows the content > of the file like in notepad.(plain code) as it supposed *to show 'x' in > browser. (as a result of execuation of file)* > > > Apache 2.2 runs in port 80 (default) > > Oracle : http://127.0.0.1:8080/apex/f?p=4550:11:4261762709150240::NO::: > (login page) > > > However at python command prompt when I execute the following: > > >>> import cx_Oracle > >>> print 'The version of cx_oracle is: ', cx_Oracle.version > The version of cx_oracle is: 5.1 > > ------------------------------------ > > > Please help me to fix this test which is for connection to oracle. > > Is it because of I yet don't have mod_python installed in my machine? > > > Your help much appreciated. > > > > Pink Floyd: >>>> We are all equal at the end. > > > > ------------------------------------------------------------------------------ > Simplify data backup and recovery for your virtual environment with > vRanger. > Installation's a snap, and flexible recovery options mean your data is > safe, > secure and there when you need it. Discover what all the cheering's about. > Get your free trial download today. > http://p.sf.net/sfu/quest-dev2dev2 > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > |