library: libMySQL
#include "TMySQLServer.h"

TMySQLServer


class description - header file - source file - inheritance tree (.pdf)

class TMySQLServer : public TSQLServer

Inheritance Chart:
TObject
<-
TSQLServer
<-
TMySQLServer

    public:
TMySQLServer(const char* db, const char* uid, const char* pw) TMySQLServer(const TMySQLServer&) ~TMySQLServer() static TClass* Class() virtual void Close(Option_t* opt = "") virtual Bool_t Commit() virtual Int_t CreateDataBase(const char* dbname) virtual Int_t DropDataBase(const char* dbname) virtual Bool_t Exec(const char* sql) virtual TSQLResult* GetColumns(const char* dbname, const char* table, const char* wild = "0") virtual TSQLResult* GetDataBases(const char* wild = "0") virtual Int_t GetMaxIdentifierLength() virtual TSQLTableInfo* GetTableInfo(const char* tablename) virtual TSQLResult* GetTables(const char* dbname, const char* wild = "0") virtual TList* GetTablesList(const char* wild = "0") virtual TClass* IsA() const virtual Bool_t IsSupportStatement() const TMySQLServer& operator=(const TMySQLServer&) virtual TSQLResult* Query(const char* sql) virtual Int_t Reload() virtual Bool_t Rollback() virtual Int_t SelectDataBase(const char* dbname) virtual const char* ServerInfo() virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual Int_t Shutdown() virtual Bool_t StartTransaction() virtual TSQLStatement* Statement(const char* sql, Int_t = 100) virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b)

Data Members

    private:
MYSQL* fMySQL connection to MySQL server

Class Description

TMySQLServer(const char *db, const char *uid, const char *pw)
 Open a connection to a MySQL DB server. The db arguments should be
 of the form "mysql://<host>[:<port>][/<database>]", e.g.:
 "mysql://pcroot.cern.ch:3456/test". The uid is the username and pw
 the password that should be used for the connection.

 In addition, several parameters can be specified in url after "?" symbold:
    timeout=N            n is connect timeout is seconds
    socket=socketname   socketname should be name of Unix socket, used for connection
    multi_statements    Tell the server that the client may send multiple statements in a single string (separated by ;);
    multi_results       Tell the server that the client can handle multiple result sets from multiple-statement executions or stored procedures.
 If several parameters are specified, they should be separated by "&" symbol
 Example of connection argument:
    TSQLServer::Connect("mysql://host.domain/test?timeout=10&multi_statements");
~TMySQLServer()
 Close connection to MySQL DB server.
void Close(Option_t *)
 Close connection to MySQL DB server.
TSQLResult * Query(const char *sql)
 Execute SQL command. Result object must be deleted by the user.
 Returns a pointer to a TSQLResult object if successful, 0 otherwise.
 The result object must be deleted by the user.
Bool_t Exec(const char* sql)
 Execute SQL command which does not produce any result sets
 Returns kTRUE is successfull
Int_t SelectDataBase(const char *dbname)
 Select a database. Returns 0 if successful, non-zero otherwise.
TSQLResult * GetDataBases(const char *wild)
 List all available databases. Wild is for wildcarding "t%" list all
 databases starting with "t".
 Returns a pointer to a TSQLResult object if successful, 0 otherwise.
 The result object must be deleted by the user.
TSQLResult * GetTables(const char *dbname, const char *wild)
 List all tables in the specified database. Wild is for wildcarding
 "t%" list all tables starting with "t".
 Returns a pointer to a TSQLResult object if successful, 0 otherwise.
 The result object must be deleted by the user.
TList* GetTablesList(const char* wild)
 Return list of tables with specified wildcard
TSQLTableInfo* GetTableInfo(const char* tablename)
 Produces SQL table info
 Object must be deleted by user
TSQLResult * GetColumns(const char *dbname, const char *table, const char *wild)
 List all columns in specified table in the specified database.
 Wild is for wildcarding "t%" list all columns starting with "t".
 Returns a pointer to a TSQLResult object if successful, 0 otherwise.
 The result object must be deleted by the user.
Int_t CreateDataBase(const char *dbname)
 Create a database. Returns 0 if successful, non-zero otherwise.
Int_t DropDataBase(const char *dbname)
 Drop (i.e. delete) a database. Returns 0 if successful, non-zero
 otherwise.
Int_t Reload()
 Reload permission tables. Returns 0 if successful, non-zero
 otherwise. User must have reload permissions.
Int_t Shutdown()
 Shutdown the database server. Returns 0 if successful, non-zero
 otherwise. User must have shutdown permissions.
const char * ServerInfo()
 Return server info.
Bool_t IsSupportStatement()
 return kTRUE if TSQLStatement class is supported.
 Starts from MySQL 4.1
TSQLStatement* Statement(const char *sql, Int_t)
 Produce TMySQLStatement
Bool_t StartTransaction()
 Start transaction
Bool_t Commit()
 Commit changes
Bool_t Rollback()
 Rollback changes
TMySQLServer(const char *db, const char *uid, const char *pw)
Int_t GetMaxIdentifierLength()

Author: Fons Rademakers 15/02/2000
Last update: root/mysql:$Name: $:$Id: TMySQLServer.cxx,v 1.15 2006/07/10 11:05:50 brun Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *


ROOT page - Class index - Class Hierarchy - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.