[DB-SIG] Experiences with DB-API2.0

Dustin Sallings dustin+pydbsig@spy.net
Thu, 20 Jun 2002 23:27:23 -0700 (PDT)


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.

--
SPY                      My girlfriend asked me which one I like better.
pub  1024/3CAE01D5 1994/11/03 Dustin Sallings <dustin@spy.net>
|    Key fingerprint =  87 02 57 08 02 D0 DA D6  C8 0F 3E 65 51 98 D8 BE
L_______________________ I hope the answer won't upset her. ____________