Re: Why Python has no equivalent of JDBC of Java?

2019-06-16 Thread Marco Sulla via Python-list
On Tue, 21 May 2019 at 01:20, Michael Torrie  wrote:

> On 05/20/2019 04:23 PM, Andrew Z wrote:
> I assume
>

Nope, it requires the instantclient and, on Linux only, also the
installclient-devel package. And a bunch of obscure and terrible settings,
like LD_LIBRARY_PATH...

On Tue, 21 May 2019 at 03:42, Chris Angelico  wrote:

> From the sound of
> things, the choice of database back end has already been made, and the
> Python script just has to cope. Otherwise, PostgreSQL would be an
> entirely better alternative.
>

Yes it's that the problem.
Well I love Postgres, but IMHO the big disadvantages over Oracle are two:
BLOBs and performance.

On Tue, 21 May 2019 at 15:14, Paul Moore  wrote:

> Because a commercial product like Oracle doesn't document
> those protocols, open-source reimplementations are hard, if not
> impossible.
>

IMHO this is the more logical answer to my doubts.

On Tue, 21 May 2019 at 18:17, Dennis Lee Bieber 
wrote:

> It wouldn't surprise me to find that they include the JDBC
> driver layer for Oracle database in the Java package}


It would surprise _me_. Oracle did not even uploaded ojdbc to the maven
repository...

On Sun, 26 May 2019 at 15:37, Bischoop  wrote:

> On 2019-05-19, Marco Sulla  wrote:
> >blablabla
> >blablablalbla
> >blablalblalbalblabla
>
> There's no perfect language mate, in some one is easier in other not,
> normal surprised you notice it so late.


I discovered it two years and an half ago, when I started to program in
Java too. Sorry if I didn't had the time to post but I'm working. And sorry
again, I don't know the whole basics of every programming language in the
world. I only programmed in Python 2 and 3, Cython, C, C++, Fortran, Qt,
PHP, Visual Basic .NET, LabView and  Javascript.


On Sun, 26 May 2019 at 19:53, Christian Gollwitzer  wrote:

> Python closer to the metal than Java? This is nonsense.
>

Well, it seems to me the majority of python db drivers uses Cython, Python
C API or external C libraries. So in this particular case Python *could* be
more performant than Java. I don't know, you should do some benchmark with
different queries, different in nature, complexity and number of rows
retrieved, on the same db, accessed once with Java and once with Python.
The problem is benchmarking Java not so easy as Python. It's very boring.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Why Python has no equivalent of JDBC of Java?

2019-06-16 Thread Peter J. Holzer
On 2019-06-16 15:45:42 +0200, Marco Sulla via Python-list wrote:
> On Tue, 21 May 2019 at 01:20, Michael Torrie  wrote:
> > On 05/20/2019 04:23 PM, Andrew Z wrote:
> > I assume
> >
It would have helped if you also quoted what Andrew assumed, not just
that he assumed something.

For the record, he assumed that JDBC also needs a native driver but that
this is automatically installed. (the assumption was wrong)

> Nope, it requires the instantclient and, on Linux only, also the
> installclient-devel package. And a bunch of obscure and terrible settings,
> like LD_LIBRARY_PATH...

If "it" means the Oracle JDBC driver, then it doesn't require those
things, which I think was your original point. Anything which uses the
Oracle native driver (Python's cx_Oracle, Perl's DBD:Oracle, etc.) needs
these things, which makes setting them up more complicated. 

The fact is that Oracle chose to write a pure-Java implementation of
their driver which is really easy to install (although it might have
some limitations) but they did no such thing for other languages - plus
their license terms make it hard to bundle their driver, so everybody
needs to go through the "install instantclient, configure instantclient,
install language-specific drivers" dance (which btw is much easier now
than it was before instantclient)

So that's the answer to your question: Because Oracle made it so.

> On Tue, 21 May 2019 at 03:42, Chris Angelico  wrote:
> > From the sound of things, the choice of database back end has
> > already been made, and the Python script just has to cope.
> > Otherwise, PostgreSQL would be an entirely better alternative.
> >
> 
> Yes it's that the problem.
> Well I love Postgres, but IMHO the big disadvantages over Oracle are two:
> BLOBs and performance.

Interesting. I think PostgreSQL's bytea type is much easier to work with
than Oracle's BLOBs, and they cover my needs (they have a 1 GB size
limit, but so far I haven't run into that). PostgreSQL also has LOs,
which seem to be even more awkward to use than Oracle's BLOBs, but I
haven't actually used them so I might be wrong.

And over the years I got the impression that PostgreSQL's performance is
at least comparable to that of Oracle - at least for "normal" databases,
not something like RAC (which I never used because we couldn't afford
it anyway). One of our databases was recently migrated to PostgreSQL and
the guy who mostly works with it was quite enthusiastic about the speed
(but there might have been other changes like new hardware ...).


> On Tue, 21 May 2019 at 15:14, Paul Moore  wrote:
> > Because a commercial product like Oracle doesn't document
> > those protocols, open-source reimplementations are hard, if not
> > impossible.
> >
> 
> IMHO this is the more logical answer to my doubts.

Oracle is also well-known for employing an army of lawyers, so the
technical difficulties might just be the beginning.

[...]

> On Sun, 26 May 2019 at 19:53, Christian Gollwitzer  wrote:
> > Python closer to the metal than Java? This is nonsense.
> >
> 
> Well, it seems to me the majority of python db drivers uses Cython,
> Python C API or external C libraries.

Which I would take as an indication that Python is "further from the
metal". Python isn't really suited for the job so you have to switch to
a lower-level (closer to the metal) language to implement it.

> So in this particular case Python *could* be more performant than
> Java.

Performance is only very indirectly related to being close to the metal.

hp

-- 
   _  | Peter J. Holzer| we build much bigger, better disasters now
|_|_) || because we have much more sophisticated
| |   | h...@hjp.at | management tools.
__/   | http://www.hjp.at/ | -- Ross Anderson 


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list