문제

I had a look at cx_Oracle but I have a couple of problems with it. First , my oracle server is on remote machine. Second I do not know on what platform my software will be deployed. All the examples I have founded

like this http://www.len.ro/2009/08/cx_oracle-on-ubuntu-9-04-jaunty/ or this https://stackoverflow.com/questions/592/cx-oracle-how-do-i-access-oracle-from-python

assume to have oracle server on the same machine. Is there possibility to have some static compilation so I can easily move my software from one pc to the other?

thx

도움이 되었습니까?

해결책

Of course cx_Oracle can work with server working on other machine. But on client machines you will have to install Oracle client and configure it. I don't know if Oracle client installation can be added to installer of your application. Normally it is huge (600 MiB or so) so it is not a good idea. Then on all client machines you will have to configure Oracle client: set ORACLE_HOME, run Oracle tools to configure connection with database etc.

The only "light" solution I know is to use JDBC from Jython or Java. In this scenario you can use "thin" version of connect string that requires only some .jar libraries. Such connect string looks like:

db = DriverManager.getConnection('jdbc:oracle:thin:169.0.1.225:1521:test_db', 'user', 'passwd')

On client machines it needs ojdbc6.jar and orai18n.jar on CLASSPATH. No installation, no configuration, simple and easy.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top