CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
ConnectionManager Class Reference

#include <ConnectionManager.h>

Public Member Functions

bool connect ()
 
 ConnectionManager ()
 
void disconnect ()
 
oracle::occi::Statement * getStatement (const std::string &query)
 

Private Attributes

oracle::occi::Connection * conn
 
oracle::occi::Environment * env
 

Detailed Description

Definition at line 14 of file ConnectionManager.h.

Constructor & Destructor Documentation

ConnectionManager::ConnectionManager ( )

Definition at line 9 of file ConnectionManager.cc.

9  : env(0), conn(0) {
10 }
oracle::occi::Connection * conn
oracle::occi::Environment * env

Member Function Documentation

bool ConnectionManager::connect ( )

Definition at line 20 of file ConnectionManager.cc.

References clean, conn, env, f, keyFile(), alignCSCRings::s, and indexGenCompare::username.

Referenced by Vispa.Gui.ZoomableScrollArea.ZoomableScrollArea::__init__(), Vispa.Views.PropertyView.BooleanProperty::__init__(), Vispa.Gui.FindDialog.FindDialog::_addScript(), Vispa.Gui.FindDialog.FindDialog::_addStringProperty(), Vispa.Main.Application.Application::_connectSignals(), Vispa.Plugins.ConfigEditor.CodeTableView.CodeTableView::_createItem(), Vispa.Gui.BoxContentDialog.BoxContentDialog::addButton(), Vispa.Gui.ToolBoxContainer.ToolBoxContainer::addWidget(), Vispa.Views.PropertyView.PropertyView::append(), Vispa.Views.PropertyView.PropertyView::appendAddRow(), Vispa.Main.Application.Application::createAction(), Vispa.Views.PropertyView.TextEditWithButtonProperty::createButton(), Vispa.Views.LineDecayView.LineDecayView::createLineDecayContainer(), Vispa.Views.PropertyView.TextEditWithButtonProperty::createLineEdit(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.PropertyView.TextEditWithButtonProperty::createTextEdit(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::filterDialog(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), HcalChannelQualityXml::getBaseLineFromOmds(), HcalChannelQualityXml::getIovsFromOmds(), HcalAssistant::getListOfChannelsFromDb(), HcalO2OManager::getListOfOmdsIovs(), HcalO2OManager::getListOfOmdsTags(), HcalChannelQualityXml::getTagsFromOmds(), Vispa.Gui.PortWidget.PortWidget::mouseMoveEvent(), Vispa.Views.PropertyView.BooleanProperty::setChecked(), Vispa.Main.SplitterTab.SplitterTab::setController(), Vispa.Plugins.Browser.BrowserTab.BrowserTab::setController(), Vispa.Views.PropertyView.BooleanProperty::setReadOnly(), Vispa.Views.PropertyView.DropDownProperty::setReadOnly(), Vispa.Views.PropertyView.TextEditWithButtonProperty::setReadOnly(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::setTab(), Vispa.Views.PropertyView.IntegerProperty::setValue(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::switchCenterView(), Vispa.Plugins.EdmBrowser.EdmBrowserTabController.EdmBrowserTabController::updateViewMenu(), and Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController::updateViewMenu().

20  {
21  if (env!=0) return true;
22  std::string username,password,database;
23 
24  char s[100];
25  FILE* f=fopen(keyFile.c_str(),"r");
26  s[0]=0; fgets(s,100,f); clean(s); username=s;
27  s[0]=0; fgets(s,100,f); clean(s); password=s;
28  s[0]=0; fgets(s,100,f); clean(s); database=s;
29  fclose(f);
30 
31  // printf("'%s' '%s' '%s'\n",username.c_str(),password.c_str(),database.c_str());
32  try {
33  env = oracle::occi::Environment::createEnvironment (oracle::occi::Environment::DEFAULT);
34  conn = env->createConnection (username, password, database);
35  } catch (...) {
36  return false;
37  }
38  return true;
39 }
oracle::occi::Connection * conn
double f[11][100]
std::vector< T * > clean
Definition: MVATrainer.cc:156
static const std::string keyFile("/nfshome0/hcalsw/.ReadOMDSKey")
oracle::occi::Environment * env
void ConnectionManager::disconnect ( )
oracle::occi::Statement * ConnectionManager::getStatement ( const std::string &  query)

Definition at line 40 of file ConnectionManager.cc.

References conn, and env.

Referenced by HcalChannelQualityXml::getBaseLineFromOmds(), HcalChannelQualityXml::getIovsFromOmds(), HcalAssistant::getListOfChannelsFromDb(), HcalO2OManager::getListOfOmdsIovs(), HcalO2OManager::getListOfOmdsTags(), and HcalChannelQualityXml::getTagsFromOmds().

40  {
41  if (env==0) return 0;
42  return conn->createStatement(query);
43 }
oracle::occi::Connection * conn
tuple query
Definition: o2o.py:269
oracle::occi::Environment * env

Member Data Documentation

oracle::occi::Connection* ConnectionManager::conn
private

Definition at line 22 of file ConnectionManager.h.

Referenced by connect(), disconnect(), and getStatement().

oracle::occi::Environment* ConnectionManager::env
private

Definition at line 21 of file ConnectionManager.h.

Referenced by connect(), disconnect(), and getStatement().