Why Python has no equivalent of JDBC of Java?
The pg python lib requires
pip pulls it as a part of the lib install, whereas in oracle case you
install the driver yourself first.(suize matters)
//for some reason i thought the driver libs come as part of cx . But it was
a year ago and my memory may play tricks on me.
On Sun, May 19, 2019, 17:44 Chris Angelico <rosuav at gmail.com> wrote:
> On Mon, May 20, 2019 at 7:34 AM Marco Sulla via Python-list
> <python-list at python.org> wrote:
> > I programmed in Python 2 and 3 for many years, and I find it a fantastic
> > language.
> > Now I'm programming in Java by m ore than 2 years, and even if I found
> > code much more boilerplate, I admit that JDBC is fantastic.
> > One example over all: Oracle. If you want to access an Oracle DB from
> > Python, you have to:
> > 1. download the Oracle instantclient and install/unzip it
> > 2. on Linux, you have also to install/unzip Development and Runtime
> > 3. on windows, you have to add the instantclient to PATH
> > 4. on Linux, you have to create a script to source that sets PATH,
> > ORACLE_HOME and LD_LIBRARY_PATH
> > Finally, you can use cx_Oracle.
> > Java? You have only to download ojdbcN.jar and add it to Maven/Gradle.
> > Why Python has no equivalent to JDBC?
> I've no idea what the hassles are with Oracle, as it's a database
> engine that I don't use. But with PostgreSQL, which I *do* use, I can
> assure you that it's much easier:
> $ pip install psycopg2
> >>> import psycopg2
> Job done.
> If Oracle is harder to use, it may be a specific issue with installing
> the Oracle client. Have you tried using pip to install cx_oracle?