From 8a384b1cae30bc21eea65bfc8c3adda2434779e6 Mon Sep 17 00:00:00 2001 From: Rene Brun <Rene.Brun@cern.ch> Date: Fri, 29 Sep 2006 10:55:58 +0000 Subject: [PATCH] From sergey Linev: TOracleServer::ServerInfo() is now implemented (thanks to Dennis Box) git-svn-id: http://root.cern.ch/svn/root/trunk@16382 27541ba8-7e3a-0410-8455-c3a389f83636 --- oracle/inc/TOracleServer.h | 3 ++- oracle/src/TOracleServer.cxx | 22 ++++++++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/oracle/inc/TOracleServer.h b/oracle/inc/TOracleServer.h index d3f83cd4255..b355cb91f41 100644 --- a/oracle/inc/TOracleServer.h +++ b/oracle/inc/TOracleServer.h @@ -1,4 +1,4 @@ -// @(#)root/physics:$Name: $:$Id: TOracleServer.h,v 1.3 2006/05/22 08:55:30 brun Exp $ +// @(#)root/physics:$Name: $:$Id: TOracleServer.h,v 1.4 2006/06/02 14:02:03 brun Exp $ // Author: Yan Liu and Shaowen Wang 23/11/04 /************************************************************************* @@ -34,6 +34,7 @@ class TOracleServer : public TSQLServer { private: Environment *fEnv; // environment of Oracle access Connection *fConn; // connection to Oracle server + TString fInfo; // info string with Oracle version information public: TOracleServer(const char *db, const char *uid, const char *pw); diff --git a/oracle/src/TOracleServer.cxx b/oracle/src/TOracleServer.cxx index 4e4c8b2957c..e0484c41ddf 100644 --- a/oracle/src/TOracleServer.cxx +++ b/oracle/src/TOracleServer.cxx @@ -1,4 +1,4 @@ -// @(#)root/oracle:$Name: $:$Id: TOracleServer.cxx,v 1.13 2006/06/25 18:43:24 brun Exp $ +// @(#)root/oracle:$Name: $:$Id: TOracleServer.cxx,v 1.14 2006/09/05 13:37:08 brun Exp $ // Author: Yan Liu and Shaowen Wang 23/11/04 /************************************************************************* @@ -462,12 +462,26 @@ Int_t TOracleServer::Shutdown() //______________________________________________________________________________ const char *TOracleServer::ServerInfo() { - // Return server info. - // NOT IMPLEMENTED. + // Return Oracle server version info. CheckConnect("ServerInfo", 0); - return "Oracle"; + fInfo = "Oracle"; + TSQLStatement* stmt = Statement("select * from v$version"); + if (stmt!=0) { + stmt->EnableErrorOutput(kFALSE); + if (stmt->Process()) { + fInfo = ""; + stmt->StoreResult(); + while (stmt->NextResultRow()) { + if (fInfo.Length()>0) fInfo += "\n"; + fInfo += stmt->GetString(0); + } + } + delete stmt; + } + + return fInfo.Data(); } //______________________________________________________________________________ -- GitLab