Text 7761, 211 rader
Skriven 2005-10-19 19:16:08 av Rich (1:379/45)
Kommentar till text 7742 av Randall Parker (1:379/45)
Ärende: Re: GPL and linking and MySQL ADO.NET driver
====================================================
From: "Rich" <@>
This is a multi-part message in MIME format.
------=_NextPart_000_034A_01C5D4E1.90056550
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
If you would load a class by name and use reflection in Java than do =
the same with ADO.NET. You can use this model if you prefer.
If you prefer connection strings you can use the OLE DB provider.
Rich
"Randall Parker" =
<obfuscate_techieSPAMpundit_now@STOPfutureSPAMpundit_with_bold_stuff.comN=
OW> wrote in message news:4355f08e$1@w3.nls.net...
Paul,
I'm amazed at just how much ADO.Net seems a step backward from an =
object oriented=20
standpoint.
In Java with JDBC one had to instantiate just a single class somewhere =
that was for a=20
specific driver. With ADO.Net one has to instantiate a number of =
different=20
driver-specific classes for a driver. I'm still learning this but =
with MySQL as an=20
example I know 3 you can to refer to so far:
MySql.Data.MySqlClient.MySqlConnection dbConn;
MySql.Data.MySqlClient.MySqlCommand dbCmd;
MySql.Data.MySqlClient.MySqlDataAdapter dbAdapter;
dbConn =3D new MySqlConnection(MyConnString);
dbConn.Open();
dbCmd =3D new MySql.Data.MySqlClient.MySqlCommand();
dbAdapter =3D new MySql.Data.MySqlClient.MySqlDataAdapter();
Now, for some of them you can assign the instantiations to what are =
basically base=20
interface types. But when you instantiate them you have to refer to =
their names.
It would make a lot more sense if off the connection object you could =
get a command=20
object and an adapter object (and some others). Then you wouldn't need =
to refer to=20
the other driver-specific class names once you'd instantiated the =
connection object.
I said on an MS forum that this seemed dumb and one of the MVPs said =
he didn't see a=20
way around the way it works.
However, with Java you can load the class name at start-up and do =
reflection or=20
something else to instantiate a class name. Perhaps with C# and =
ADO.Net you might be=20
able to load the class name as a string and somehow instantiate it and =
use interface=20
types to declare variables? Not sure.
Paul Ranson wrote:
> That seems somewhat retarded. What's the point of abstraction if you =
have to=20
> know what you're going to be using at that level?
>=20
> Does the MySQL code not implement an OleDB provider? I'd have =
expected to=20
> just be able to name the data source but it's not my field.
>=20
> Paul
>=20
> "Randall Parker"=20
> =
<obfuscate_techieSPAMpundit_now@STOPfutureSPAMpundit_with_bold_stuff.comN=
OW>=20
> wrote in message news:435525bb$1@w3.nls.net...
>=20
>>Paul,
>>
>>You actually have to refer to the MySQL driver by name in your =
source=20
>>code. In C#:
>>
>>using MySql.Data.MySqlClient;
------=_NextPart_000_034A_01C5D4E1.90056550
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2769" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2> If you would load a class =
by name and=20
use reflection in Java than do the same with ADO.NET. You can use =
this=20
model if you prefer.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> If you prefer connection =
strings you=20
can use the OLE DB provider.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Rich</FONT></DIV>
<DIV> </DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Randall Parker" <<A=20
=
href=3D"mailto:obfuscate_techieSPAMpundit_now@STOPfutureSPAMpundit_with_b=
old_stuff.comNOW">obfuscate_techieSPAMpundit_now@STOPfutureSPAMpundit_wit=
h_bold_stuff.comNOW</A>>=20
wrote in message <A=20
=
href=3D"news:4355f08e$1@w3.nls.net">news:4355f08e$1@w3.nls.net</A>...</DI=
V>Paul,<BR><BR>I'm=20
amazed at just how much ADO.Net seems a step backward from an object =
oriented=20
<BR>standpoint.<BR><BR>In Java with JDBC one had to instantiate just a =
single=20
class somewhere that was for a <BR>specific driver. With ADO.Net one =
has to=20
instantiate a number of different <BR>driver-specific classes for a=20
driver. I'm still learning this but with MySQL as an <BR>example =
I know=20
3 you can to refer to so=20
far:<BR><BR> =20
MySql.Data.MySqlClient.MySqlConnection=20
dbConn;<BR> =20
MySql.Data.MySqlClient.MySqlCommand=20
dbCmd;<BR> =20
MySql.Data.MySqlClient.MySqlDataAdapter=20
=
dbAdapter;<BR><BR> =
dbConn =3D new=20
=
MySqlConnection(MyConnString);<BR> &nb=
sp; =20
=
dbConn.Open();<BR> =
dbCmd=20
=3D new=20
=
MySql.Data.MySqlClient.MySqlCommand();<BR> &=
nbsp; =20
dbAdapter =3D new =
MySql.Data.MySqlClient.MySqlDataAdapter();<BR><BR>Now, for=20
some of them you can assign the instantiations to what are basically =
base=20
<BR>interface types. But when you instantiate them you have to refer =
to their=20
names.<BR><BR>It would make a lot more sense if off the connection =
object you=20
could get a command <BR>object and an adapter object (and some =
others). Then=20
you wouldn't need to refer to <BR>the other driver-specific class =
names once=20
you'd instantiated the connection object.<BR><BR>I said on an MS forum =
that=20
this seemed dumb and one of the MVPs said he didn't see a <BR>way =
around the=20
way it works.<BR><BR>However, with Java you can load the class name at =
start-up and do reflection or <BR>something else to instantiate a =
class name.=20
Perhaps with C# and ADO.Net you might be <BR>able to load the class =
name as a=20
string and somehow instantiate it and use interface <BR>types to =
declare=20
variables? Not sure.<BR><BR><BR>Paul Ranson wrote:<BR>> That seems =
somewhat=20
retarded. What's the point of abstraction if you have to <BR>> know =
what=20
you're going to be using at that level?<BR>> <BR>> Does the =
MySQL code=20
not implement an OleDB provider? I'd have expected to <BR>> just be =
able to=20
name the data source but it's not my field.<BR>> <BR>> =
Paul<BR>>=20
<BR>> "Randall Parker" <BR>> <<A=20
=
href=3D"mailto:obfuscate_techieSPAMpundit_now@STOPfutureSPAMpundit_with_b=
old_stuff.comNOW">obfuscate_techieSPAMpundit_now@STOPfutureSPAMpundit_wit=
h_bold_stuff.comNOW</A>>=20
<BR>> wrote in message <A=20
=
href=3D"news:435525bb$1@w3.nls.net">news:435525bb$1@w3.nls.net</A>...<BR>=
>=20
<BR>>>Paul,<BR>>><BR>>>You actually have to refer to =
the=20
MySQL driver by name in your source <BR>>>code. In=20
C#:<BR>>><BR>>>using=20
MySql.Data.MySqlClient;</BLOCKQUOTE></BODY></HTML>
------=_NextPart_000_034A_01C5D4E1.90056550--
--- BBBS/NT v4.01 Flag-5
* Origin: Barktopia BBS Site http://HarborWebs.com:8081 (1:379/45)
|