library: libRODBC #include "TODBCServer.h" |
TODBCServer(const TODBCServer&) | |
TODBCServer(const char* db, const char* uid, const char* pw) | |
virtual | ~TODBCServer() |
void | TObject::AbstractMethod(const char* method) const |
virtual void | TObject::AppendPad(Option_t* option = "") |
virtual void | TObject::Browse(TBrowser* b) |
static TClass* | Class() |
virtual const char* | TObject::ClassName() const |
virtual void | TObject::Clear(Option_t* = "") |
virtual TObject* | TObject::Clone(const char* newname = "") const |
virtual void | Close(Option_t* opt = "") |
virtual Bool_t | Commit() |
virtual Int_t | TObject::Compare(const TObject* obj) const |
static TSQLServer* | TSQLServer::Connect(const char* db, const char* uid, const char* pw) |
virtual void | TObject::Copy(TObject& object) const |
virtual Int_t | CreateDataBase(const char* dbname) |
virtual void | TObject::Delete(Option_t* option = "") |
virtual Int_t | TObject::DistancetoPrimitive(Int_t px, Int_t py) |
virtual void | TObject::Draw(Option_t* option = "") |
virtual void | TObject::DrawClass() const |
virtual TObject* | TObject::DrawClone(Option_t* option = "") const |
virtual Int_t | DropDataBase(const char* dbname) |
virtual void | TObject::Dump() const |
virtual void | TSQLServer::EnableErrorOutput(Bool_t on = kTRUE) |
virtual void | TObject::Error(const char* method, const char* msgfmt) const |
virtual Bool_t | Exec(const char* sql) |
virtual void | TObject::Execute(const char* method, const char* params, Int_t* error = 0) |
virtual void | TObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0) |
virtual void | TObject::ExecuteEvent(Int_t event, Int_t px, Int_t py) |
virtual void | TObject::Fatal(const char* method, const char* msgfmt) const |
virtual TObject* | TObject::FindObject(const char* name) const |
virtual TObject* | TObject::FindObject(const TObject* obj) const |
virtual TSQLResult* | GetColumns(const char* dbname, const char* table, const char* wild = "0") |
virtual TSQLResult* | GetDataBases(const char* wild = "0") |
static TList* | GetDataSources() |
const char* | TSQLServer::GetDB() const |
const char* | TSQLServer::GetDBMS() const |
virtual Option_t* | TObject::GetDrawOption() const |
static TList* | GetDrivers() |
static Long_t | TObject::GetDtorOnly() |
virtual Int_t | TSQLServer::GetErrorCode() const |
virtual const char* | TSQLServer::GetErrorMsg() const |
const char* | TSQLServer::GetHost() const |
virtual const char* | TObject::GetIconName() const |
virtual Int_t | GetMaxIdentifierLength() |
virtual const char* | TObject::GetName() const |
virtual char* | TObject::GetObjectInfo(Int_t px, Int_t py) const |
static Bool_t | TObject::GetObjectStat() |
virtual Option_t* | TObject::GetOption() const |
Int_t | TSQLServer::GetPort() const |
virtual TSQLTableInfo* | GetTableInfo(const char* tablename) |
virtual TSQLResult* | GetTables(const char* dbname, const char* wild = "0") |
virtual TList* | GetTablesList(const char* wild = "0") |
virtual const char* | TObject::GetTitle() const |
virtual UInt_t | TObject::GetUniqueID() const |
virtual Bool_t | TObject::HandleTimer(TTimer* timer) |
virtual ULong_t | TObject::Hash() const |
virtual Bool_t | TSQLServer::HasTable(const char* tablename) |
virtual void | TObject::Info(const char* method, const char* msgfmt) const |
virtual Bool_t | TObject::InheritsFrom(const char* classname) const |
virtual Bool_t | TObject::InheritsFrom(const TClass* cl) const |
virtual void | TObject::Inspect() const |
void | TObject::InvertBit(UInt_t f) |
virtual TClass* | IsA() const |
virtual Bool_t | TSQLServer::IsConnected() const |
virtual Bool_t | TObject::IsEqual(const TObject* obj) const |
virtual Bool_t | TSQLServer::IsError() const |
virtual Bool_t | TObject::IsFolder() const |
Bool_t | TObject::IsOnHeap() const |
virtual Bool_t | TObject::IsSortable() const |
virtual Bool_t | IsSupportStatement() const |
Bool_t | TObject::IsZombie() const |
virtual void | TObject::ls(Option_t* option = "") const |
void | TObject::MayNotUse(const char* method) const |
virtual Bool_t | TObject::Notify() |
static void | TObject::operator delete(void* ptr) |
static void | TObject::operator delete(void* ptr, void* vp) |
static void | TObject::operator delete[](void* ptr) |
static void | TObject::operator delete[](void* ptr, void* vp) |
void* | TObject::operator new(size_t sz) |
void* | TObject::operator new(size_t sz, void* vp) |
void* | TObject::operator new[](size_t sz) |
void* | TObject::operator new[](size_t sz, void* vp) |
TODBCServer& | operator=(const TODBCServer&) |
virtual void | TObject::Paint(Option_t* option = "") |
virtual void | TObject::Pop() |
virtual void | TObject::Print(Option_t* option = "") const |
static void | PrintDataSources() |
static void | PrintDrivers() |
virtual TSQLResult* | Query(const char* sql) |
virtual Int_t | TObject::Read(const char* name) |
virtual void | TObject::RecursiveRemove(TObject* obj) |
virtual Int_t | Reload() |
void | TObject::ResetBit(UInt_t f) |
virtual Bool_t | Rollback() |
virtual void | TObject::SaveAs(const char* filename = "", Option_t* option = "") const |
virtual void | TObject::SavePrimitive(ostream& out, Option_t* option = "") |
virtual Int_t | SelectDataBase(const char* dbname) |
virtual const char* | ServerInfo() |
void | TObject::SetBit(UInt_t f) |
void | TObject::SetBit(UInt_t f, Bool_t set) |
virtual void | TObject::SetDrawOption(Option_t* option = "") |
static void | TObject::SetDtorOnly(void* obj) |
static void | TObject::SetObjectStat(Bool_t stat) |
virtual void | TObject::SetUniqueID(UInt_t uid) |
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) |
virtual void | TObject::SysError(const char* method, const char* msgfmt) const |
Bool_t | TObject::TestBit(UInt_t f) const |
Int_t | TObject::TestBits(UInt_t f) const |
virtual void | TObject::UseCurrentStyle() |
virtual void | TObject::Warning(const char* method, const char* msgfmt) const |
virtual Int_t | TObject::Write(const char* name = "0", Int_t option = 0, Int_t bufsize = 0) |
virtual Int_t | TObject::Write(const char* name = "0", Int_t option = 0, Int_t bufsize = 0) const |
void | TSQLServer::ClearError() |
virtual void | TObject::DoError(int level, const char* location, const char* fmt, va_list va) const |
void | TObject::MakeZombie() |
void | TSQLServer::SetError(Int_t code, const char* msg, const char* method = "0") |
Bool_t | EndTransaction(Bool_t commit) |
Bool_t | ExtractErrors(short retcode, const char* method) |
static TList* | ListData(Bool_t isdrivers) |
enum TSQLServer::ESQLDataTypes { | kSQL_NONE | |
kSQL_CHAR | ||
kSQL_VARCHAR | ||
kSQL_INTEGER | ||
kSQL_FLOAT | ||
kSQL_DOUBLE | ||
kSQL_NUMERIC | ||
kSQL_BINARY | ||
kSQL_TIMESTAMP | ||
}; | ||
enum TObject::EStatusBits { | kCanDelete | |
kMustCleanup | ||
kObjInCanvas | ||
kIsReferenced | ||
kHasUUID | ||
kCannotPick | ||
kNoContextMenu | ||
kInvalidObject | ||
}; | ||
enum TObject::[unnamed] { | kIsOnHeap | |
kNotDeleted | ||
kZombie | ||
kBitMask | ||
kSingleKey | ||
kOverwrite | ||
kWriteDelete | ||
}; |
TString | TSQLServer::fType | type of DBMS (MySQL, Oracle, SysBase, ...) |
TString | TSQLServer::fHost | host to which we are connected |
TString | TSQLServer::fDB | currently selected DB |
Int_t | TSQLServer::fPort | port to which we are connected |
Int_t | TSQLServer::fErrorCode | error code of last operation |
TString | TSQLServer::fErrorMsg | error message of last operation |
Bool_t | TSQLServer::fErrorOut | enable error output |
Open a connection to a ODBC server. The db arguments can be: 1. Form "odbc://[user[:passwd]@]<host>[:<port>][/<database>][?Driver]", e.g.: "odbc://pcroot.cern.ch:3306/test?MySQL". Driver argument specifies ODBC driver, which should be used for connection. By default, MyODBC driver name is used. The uid is the username and pw the password that should be used for the connection. If uid and pw are not specified (==0), user and passwd arguments from URL will be used. Works only with MySQL ODBC, probably with PostrSQL ODBC. 2. Form "odbcd://DRIVER={MyODBC};SERVER=pcroot.cern.ch;DATABASE=test;USER=user;PASSWORD=pass;OPTION=3;PORT=3306;" This is a form, which is accepted by SQLDriverConnect function of ODBC. Here some other arguments can be specified, which are not included in standard URL format. 3. Form "odbcn://MySpecialConfig", where MySpecialConfig is entry, defined in user DSN (user data source). Here uid and pw should be always specified. Configuring unixODBC under Linux: http://www.unixodbc.org/odbcinst.html Remarks: for variants 1 & 2 it is enough to create/configure odbcinst.ini file. For variant 3 file odbc.ini should be created. Path to this files can be specified in enviromental variables like export ODBCINI=/home/my/unixODBC/etc/odbc.ini export ODBCSYSINI=/home/my/unixODBC/etc Configuring MySQL ODBC under Windows. Installing ODBC driver for MySQL is enough to use it under Windows. Afer odbcd:// variant can be used with DRIVER={MySQL ODBC 3.51 Driver}; To configure User DSN, go into Start menu -> Settings -> Control panel -> Administrative tools-> Data Sources (ODBC). To install Oracle ODBC driver for Windows, one should download and install either complete Oracle client (~500 MB), or so-called Instant Client Basic and Instant Client ODBC (~20 MB together). Some remark about Instant Client: 1) Two additional DLLs are required: mfc71.dll & msver71.dll They can be found either in MS VC++ 7.1 Free Toolkit or downloaded from other Internet sites 2) ORACLE_HOME enviroment variable should be specified and point to location, where Instant Client files are extracted 3) Run odbc_install.exe from account with administrative rights 3) In $ORACLE_HOME/network/admin/ directory appropriate *.ora files like ldap.ora, sqlnet.ora, tnsnames.ora should be installed. Contact your Oracle administrator to get these files. After Oracle ODBC driver is installed, appropriate entry in ODBC drivers list like "Oracle in instantclient10_2" should appiar. Connection string example: "odbcd://DRIVER={Oracle in instantclient10_2};DBQ=db-test;UID=user_name;PWD=user_pass;";
Produce TList object with list of available ODBC drivers (isdrivers = kTRUE) or data sources (isdrivers = kFALSE)
Produce TList object with list of available ODBC drivers User must delete TList object aftewards Name of driver can be used in connecting to data base in form TSQLServer::Connect("odbcd://DRIVER={<drivername>};DBQ=<dbname>;UID=user;PWD=pass;", 0, 0);
Produce TList object with list of available ODBC data sources User must delete TList object aftewards Name of data source can be used later for connection: TSQLServer::Connect("odbcn://<data_source_name>", "user", "pass");
Extract errors, produced by last ODBC function call
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.
Executes query which does not produce any results set Return kTRUE if successfull
Select a database. Returns 0 if successful, non-zero otherwise. Not all RDBMS support selecting of database (catalog) after connecting Normally user should specify database name at time of connection
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.
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.
Return list of tables in database See TSQLServer::GetTablesList() for details.
Produces SQL table info Object must be deleted by user
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.
returns maximum allowed length of identifier (table name, column name, index name)
Drop (i.e. delete) a database. Returns 0 if successful, non-zero otherwise.
Reload permission tables. Returns 0 if successful, non-zero otherwise. User must have reload permissions.
Shutdown the database server. Returns 0 if successful, non-zero otherwise. User must have shutdown permissions.
Creates ODBC statement for provided query. See TSQLStatement class for more details.
Starts transaction. Check for transaction support. Switch off autocommitment mode.
Complete current transaction (commit = kTRUE) or rollback Switches on autocommit mode of ODBC driver