[DB-SIG] Experiences with DB-API2.0
M.-A. Lemburg
mal@lemburg.com
Fri, 21 Jun 2002 11:04:21 +0200
Dustin Sallings wrote:
> Around 20:45 on Jun 20, 2002, Matthew T. Kromer said:
>
> # I also have to chuckle every time someone wants a "purely generic"
> # interface. Most RDBMS have divergent SQL dialects, with divergent
> # types. Any "power user" usually is tied to a specific RDBMS and wants
> # to maximize it, and thus is going to get very frustrated when there is
> # no "generic" way to access a very specific feature.
>
> JDBC does a great job here. Regardless of dialect, queries are
> always sent the same way to the backend and most of the common database
> types are covered. And for your ``power users,'' there's this:
>
> OTHER
>
> The constant in the Java programming language that indicates
> that the SQL type is database-specific and gets mapped to a Java
> object that can be accessed via the methods getObject and
> setObject.
>
> That doesn't cover every strange thing a DB does, but for those
> really special-purpose things, you can always cast your Connection object
> to the specific class (postgres used to have to do this for BLOBs, but
> JDBC covers BLOBs in a standard way now).
>
> I just don't think it's OK to say that the API doesn't have to be
> common across drivers simply because there's a possibility to use
> non-portable SQL dialects.
>
> I encourage you to read through the classes in java.sql. I don't
> believe it needs to be entirely cloned, but it's extremely powerful from
> an application developer's point of view. It's unambiguous and leaves you
> with nothing to worry about but your SQL dialect. And it's even got
> facilities to tell you what specific features of the database supports.
That's what mxODBC gives you as well: a standard interface
to all kinds of databases, including the catalog methods you
mentioned. (Note that JDBC was modelled after ODBC.)
I don't see a need to tweak the DB API and force this concept
onto all other module writers.
--
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
______________________________________________________________________
Company & Consulting: http://www.egenix.com/
Python Software: http://www.egenix.com/files/python/
Meet us at EuroPython 2002: http://www.europython.org/