00001 // @(#)root/pgsql:$Id: TPgSQLServer.h 20882 2007-11-19 11:31:26Z rdm $ 00002 // Author: g.p.ciceri <gp.ciceri@acm.org> 01/06/2001 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2001, Rene Brun and Fons Rademakers. * 00006 * All rights reserved. * 00007 * * 00008 * For the licensing terms see $ROOTSYS/LICENSE. * 00009 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00010 *************************************************************************/ 00011 00012 #ifndef ROOT_TPgSQLServer 00013 #define ROOT_TPgSQLServer 00014 00015 #ifndef ROOT_TSQLServer 00016 #include "TSQLServer.h" 00017 #endif 00018 00019 #if !defined(__CINT__) 00020 #include <libpq-fe.h> 00021 #else 00022 struct PGconn; 00023 #endif 00024 00025 00026 00027 class TPgSQLServer : public TSQLServer { 00028 00029 private: 00030 PGconn *fPgSQL; // connection to PgSQL server 00031 00032 public: 00033 TPgSQLServer(const char *db, const char *uid, const char *pw); 00034 ~TPgSQLServer(); 00035 00036 void Close(Option_t *opt=""); 00037 TSQLResult *Query(const char *sql); 00038 TSQLStatement *Statement(const char *sql, Int_t = 100); 00039 Bool_t HasStatement() const; 00040 Int_t SelectDataBase(const char *dbname); 00041 TSQLResult *GetDataBases(const char *wild = 0); 00042 TSQLResult *GetTables(const char *dbname, const char *wild = 0); 00043 TSQLResult *GetColumns(const char *dbname, const char *table, const char *wild = 0); 00044 Int_t CreateDataBase(const char *dbname); 00045 Int_t DropDataBase(const char *dbname); 00046 Int_t Reload(); 00047 Int_t Shutdown(); 00048 const char *ServerInfo(); 00049 00050 ClassDef(TPgSQLServer,0) // Connection to PgSQL server 00051 }; 00052 00053 #endif