Re: use TMySQLServer in lxplus

From: Christian Holm Christensen <cholm_at_nbi.dk>
Date: Mon, 23 Jun 2008 23:38:49 +0200


Hi Zhijun,

On Mon, 2008-06-23 at 09:44 +0200, liang wrote: ...
> root [0] TMySQLServer a

Though not the root of your problem, you should _never_ use the TMySQLServer interface directly. You should instead use the virtual TSQLServer interface, like

        Root> TSQLServer* server =
        TSQLServer::Connect("mysql://host/DB");
        

since that is by far more flexible and the way the SQL stuff was designed. TSQLServer::Connect will ask, behind the sense, the plug-in manager for the appropriate handler for the "protocol" 'mysql:', load the plug-in and make an object of the appropriate class.

Similar remarks holds for all derived classes of any TVirtual<XYZ> class in ROOT. Use the virtual interface only - never the concrete implementation. If a concrete implementation offers more functionality than the virtual base class, it's a mistake in either the concrete derived class, or the virtual interface isn't defined properly. In any case, it should be considered a bug, and user code shouldn't rely on the extended behaviour.

It would be good, if the constructors of the various concrete implementation of TSQLServer would be "private" or at least "protected".

Yours,

-- 
 ___  |  Christian Holm Christensen 
  |_| |  -------------------------------------------------------------
    | |  Address: Sankt Hansgade 23, 1. th.  Phone:  (+45) 35 35 96 91
     _|           DK-2200 Copenhagen N       Cell:   (+45) 24 61 85 91
    _|            Denmark                    Office: (+45) 353  25 447
 ____|   Email:   cholm_at_nbi.dk               Web:    www.nbi.dk/~cholm
 | |
Received on Mon Jun 23 2008 - 23:37:57 CEST

This archive was generated by hypermail 2.2.0 : Wed Jun 25 2008 - 17:50:01 CEST