CMS 3D CMS Logo

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

#include <EcalDBConnection.h>

Inheritance diagram for EcalDBConnection:
EcalCondDBInterface EcalTPGDBApp

Public Member Functions

void commit ()
 
oracle::occi::Statement * createStatement ()
 
 EcalDBConnection (std::string host, std::string sid, std::string user, std::string pass, int port=1521) noexcept(false)
 
 EcalDBConnection (std::string sid, std::string user, std::string pass) noexcept(false)
 
oracle::occi::Clob getClobLocator ()
 
oracle::occi::Connection * getConn () const
 
oracle::occi::Environment * getEnv () const
 
void rollback ()
 
void terminateStatement (oracle::occi::Statement *stmt)
 
virtual ~EcalDBConnection () noexcept(false)
 

Protected Attributes

oracle::occi::Connection * conn
 
oracle::occi::Environment * env
 
std::string host
 
std::string pass
 
int port
 
std::string sid
 
oracle::occi::Statement * stmt
 
std::string user
 

Detailed Description

A wrapper class for the oracle Connection and Environment classes along with any OCCI-dependent methods that are useful for any database

Definition at line 15 of file EcalDBConnection.h.

Constructor & Destructor Documentation

EcalDBConnection::EcalDBConnection ( std::string  host,
std::string  sid,
std::string  user,
std::string  pass,
int  port = 1521 
)
noexcept

Constructor Makes a connection to an oracle database without TNS_ADMIN

EcalDBConnection::EcalDBConnection ( std::string  sid,
std::string  user,
std::string  pass 
)
noexcept

Constructor Makes a connection to an oracle database using TNS_ADMIN

EcalDBConnection::~EcalDBConnection ( )
virtualnoexcept

Destructor

Definition at line 50 of file EcalDBConnection.cc.

References getInfo::conn, and web.browse_db::env.

50  {
51  //Close database conection and terminate environment
52  try {
53  conn->terminateStatement(stmt);
54  env->terminateConnection(conn);
55  Environment::terminateEnvironment(env);
56  } catch (SQLException &e) {
57  throw(std::runtime_error("ERROR: Destructor Failed: " + e.getMessage()));
58  }
59 }
oracle::occi::Environment * env
oracle::occi::Connection * conn
oracle::occi::Statement * stmt

Member Function Documentation

void EcalDBConnection::commit ( )
inline

Tranaction manaagement

Definition at line 55 of file EcalDBConnection.h.

References conn.

55 { conn->commit(); }
oracle::occi::Connection * conn
oracle::occi::Statement* EcalDBConnection::createStatement ( )
inline

Get a new Statement

Definition at line 42 of file EcalDBConnection.h.

References conn, and gather_cfg::cout.

42  {
43  std::cout << "Creating statement" << std::endl;
44  return conn->createStatement();
45  }
oracle::occi::Connection * conn
tuple cout
Definition: gather_cfg.py:144
oracle::occi::Clob EcalDBConnection::getClobLocator ( )
inline

Get a new clob locator

Definition at line 61 of file EcalDBConnection.h.

References conn.

61 { return oracle::occi::Clob(conn); }
oracle::occi::Connection * conn
oracle::occi::Connection* EcalDBConnection::getConn ( ) const
inline

Definition at line 64 of file EcalDBConnection.h.

References conn.

Referenced by LMFCorrCoefDat::LMFCorrCoefDat(), LMFDefFabric::LMFDefFabric(), LMFIOV::LMFIOV(), and LMFUnique::LMFUnique().

64 { return conn; };
oracle::occi::Connection * conn
oracle::occi::Environment* EcalDBConnection::getEnv ( ) const
inline

Definition at line 63 of file EcalDBConnection.h.

References env.

Referenced by LMFCorrCoefDat::LMFCorrCoefDat(), LMFDefFabric::LMFDefFabric(), LMFIOV::LMFIOV(), and LMFUnique::LMFUnique().

63 { return env; };
oracle::occi::Environment * env
void EcalDBConnection::rollback ( )
inline

Definition at line 56 of file EcalDBConnection.h.

References conn.

56 { conn->rollback(); }
oracle::occi::Connection * conn
void EcalDBConnection::terminateStatement ( oracle::occi::Statement *  stmt)
inline

Definition at line 47 of file EcalDBConnection.h.

References conn, and gather_cfg::cout.

47  {
48  std::cout << "Creating statement" << std::endl;
49  conn->terminateStatement(stmt);
50  }
oracle::occi::Connection * conn
oracle::occi::Statement * stmt
tuple cout
Definition: gather_cfg.py:144

Member Data Documentation

oracle::occi::Connection* EcalDBConnection::conn
protected
oracle::occi::Environment* EcalDBConnection::env
protected
std::string EcalDBConnection::host
protected

Definition at line 75 of file EcalDBConnection.h.

std::string EcalDBConnection::pass
protected

Definition at line 79 of file EcalDBConnection.h.

int EcalDBConnection::port
protected

Definition at line 76 of file EcalDBConnection.h.

std::string EcalDBConnection::sid
protected

Definition at line 77 of file EcalDBConnection.h.

oracle::occi::Statement* EcalDBConnection::stmt
protected

Definition at line 73 of file EcalDBConnection.h.

std::string EcalDBConnection::user
protected