[Mono-list] .NET version 1.1 and 2.0

Rodrigo Moya rodrigo@ximian.com
18 Jul 2002 19:14:43 +0200


On Tue, 2002-07-16 at 22:18, Miguel de Icaza wrote:
> 	* ADO.NET: The database guys should chime in with their
> 	  comments, I am not a DB person, and I am passing along what
> 	  people who have built these systems before told me.
> 
the biggest problem in ADO.NET I see myself is the impossibility of using it as
a generic database access layer. That is, to create a connection, you have to
know in advance the DB server/API you are going to use, which is ok for some
cases but not for generic database access.

What I miss is something along the way the driver manager in JDBC, which allows
to activate a driver via an identifier:

DriverManager dm = new DriverManager ();
IDbConnection cnc = dm.GetConnection ("PostgreSQL");

or something similar. This would be much better than:

if (i_want_postgres)
	cnc = new PostgresConnection ();
else if (i_want_sql_server)
	cnc = new SqlConnection ();
else if (i_want_generic_but_im_not_sure_there_are_drivers_installed)
	cnc = new OleDbConnection ();

Once you get a valid IDbConnection, you can do generic usage of the class libraries
(using the interfaces), but to get to that point, AFAIK, you have to know in
advance the DB server you'll be connecting to.

cheers
-- 
Rodrigo Moya <rodrigo@ximian.com>