[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Why Python has no equivalent of JDBC of Java?

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 its
> 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 package
> 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,
> 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?