Re: TSQLServer & TMySQLServer

From: Fons Rademakers <Fons.Rademakers_at_cern.ch>
Date: Fri, 1 Oct 2010 14:21:18 +0200


Hi Bernd,

    TSQLServer is not a pure abstract class but it acts as one. We advice to create an actual instance of a TSQLServer dreived class by using:

TSQLServer::Connect()

where the url passed to connect makes sure the correct plugin and derived class is loaded (be it TOracleServer, TMySQLServer, etc). This is like how things are done for TFile via TFile::Open(). This makes you code independent of an actual specific implementation.

Cheers, Fons.

On 01/10/2010 11:30, Bernd Reinhold wrote:
> Hi Rene!
>
> Yes, I understand that TSQLServer is a base class to TMySQLServer,
> TOracle... etc., but it's not an abstract base class, despite the fact that
> in http://root.cern.ch/root/html/TSQLServer.html it says so.
> So I have two choices to connect to a MySQL server: TSQLServer or
> TMySQLServer (we tested both, either worked).
>
> Therefore I was wondering
> >> ..., if one (e.g. TMySQLServer) is preferred above the
> >> other (TSQLServer), e.g. for performance reasons or if they are
> >> completely equivalent to use.
>
> They seemed equivalent when testing, but I was wondering about subtle or
> not so subtle differences?!
>
> Thanks and cheers, Bernd.
>
> Rene Brun wrote:
>> Bernd,
>>
>> Note that TMySQLServer is just an incarnation of TSQLServer base class,
>> like we have TOracleServer, etc.
>>
>> Rene
>>
>> On 30/09/2010 17:15, Bernd Reinhold wrote:
>>> Dear ROOTers!
>>>
>>> With ROOT comes a class TSQLServer, TSQLResult, TSQLRow but there are
>>> also TMySQLServer, et al. Either can be used to connect to a mySQL server.
>>>
>>> Now I was wondering, if one (e.g. TMySQLServer) is preferred above the
>>> other (TSQLServer), e.g. for performance reasons or if they are
>>> completely equivalent to use.
>>>
>>> Thanks and cheers, Bernd.
>>>
>>
>>
>

-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers_at_cern.ch              Phone: +41 22 7679248
WWW:    http://fons.rademakers.org           Fax:   +41 22 7669640
Received on Fri Oct 01 2010 - 14:21:22 CEST

This archive was generated by hypermail 2.2.0 : Fri Oct 01 2010 - 17:50:01 CEST