Why Python has no equivalent of JDBC of Java?

Thomas Jollans tjol at tjol.eu
Mon May 20 11:23:59 EDT 2019


On 19/05/2019 14.27, Marco Sulla via Python-list 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.

Python has a the "Python Database API" (DB API 2.0)
https://www.python.org/dev/peps/pep-0249/

All SQL database modules that I know of use this API. It's more
decentralized than JDBC (not that I know much about JDBC), but it does
the trick: as long as the SQL syntax is sufficiently compatible, you can
easily swap in one database for another.

> 
> One example over all: Oracle. If you want to access an Oracle DB from
> Python, you have to:

If Oracle wants to be a pain in the arse, that's Oracle's doing. The
open source databases aren't like that.

-- Thomas



More information about the Python-list mailing list