Logo ROOT   6.16/01
Reference Guide
TSapDBServer.h
Go to the documentation of this file.
1// @(#)root/sapdb:$Id$
2// Author: Mark Hemberger & Fons Rademakers 03/08/2001
3
4/*************************************************************************
5 * Copyright (C) 1995-2001, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TSapDBServer
13#define ROOT_TSapDBServer
14
15#include "TSQLServer.h"
16
17#include <ctime>
18#include <WINDOWS.H>
19#ifdef min
20#undef min
21#endif
22#ifdef max
23#undef max
24#endif
25#include <sql.h>
26#include <sqlext.h>
27
28class TSapDBServer : public TSQLServer {
29
30private:
31 SQLHDBC fSapDB; // connection to SapDB server
32 SQLHENV fEnv; // environment for/of ODBC call
33 SQLHSTMT fStmt; // statement result set
34 SQLHSTMT fStmtCnt; // statement result set
35
36 static Int_t printSQLError(SQLHDBC hdbc, SQLHSTMT hstmt);
37
38public:
39 TSapDBServer(const char *db, const char *uid, const char *pw);
41
42 void Close(Option_t *opt="");
43 TSQLResult *Query(const char *sql);
44 Int_t SelectDataBase(const char *dbname);
45 TSQLResult *GetDataBases(const char *wild = 0);
46 TSQLResult *GetTables(const char *dbname, const char *wild = 0);
47 TSQLResult *GetColumns(const char *dbname, const char *table, const char *wild = 0);
48 Int_t CreateDataBase(const char *dbname);
49 Int_t DropDataBase(const char *dbname);
50 Int_t Reload();
52 const char *ServerInfo();
53
54 ClassDef(TSapDBServer,0) // Connection to SapDB server
55};
56
57#endif
int Int_t
Definition: RtypesCore.h:41
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:324
Int_t SelectDataBase(const char *dbname)
Select a database.
TSapDBServer(const char *db, const char *uid, const char *pw)
Open a connection to a SapDB DB server.
void Close(Option_t *opt="")
Close connection to SapDB DB server.
~TSapDBServer()
Close connection to SapDB DB server.
static Int_t printSQLError(SQLHDBC hdbc, SQLHSTMT hstmt)
Print SapDB error message.
SQLHSTMT fStmtCnt
Definition: TSapDBServer.h:34
Int_t CreateDataBase(const char *dbname)
Create a database.
SQLHSTMT fStmt
Definition: TSapDBServer.h:33
TSQLResult * GetTables(const char *dbname, const char *wild=0)
List all tables in the specified database.
TSQLResult * GetColumns(const char *dbname, const char *table, const char *wild=0)
List all columns in specified table in the specified database.
Int_t DropDataBase(const char *dbname)
Drop (i.e.
const char * ServerInfo()
Return server info.
Int_t Shutdown()
Shutdown the database server.
TSQLResult * Query(const char *sql)
Execute SQL command.
SQLHENV fEnv
Definition: TSapDBServer.h:32
SQLHDBC fSapDB
Definition: TSapDBServer.h:31
Int_t Reload()
Reload permission tables.
TSQLResult * GetDataBases(const char *wild=0)
List all available databases.
void table()
Definition: table.C:85