Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
odbc::Connection Class Reference

#include <RDBC/blob/master/include/RDBC/odbc++/connection.h>

+ Inheritance diagram for odbc::Connection:
+ Collaboration diagram for odbc::Connection:

Public Types

enum  TransactionIsolation {
  TRANSACTION_NONE, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_READ_COMMITTED, TRANSACTION_REPEATABLE_READ,
  TRANSACTION_SERIALIZABLE
}
 

Public Member Functions

virtual ~Connection ()
 
bool getAutoCommit ()
 
void setAutoCommit (bool autoCommit)
 
void commit ()
 
void rollback ()
 
ODBCXX_STRING getCatalog ()
 
void setCatalog (const ODBCXX_STRING &catalog)
 
TransactionIsolation getTransactionIsolation ()
 
void setTransactionIsolation (TransactionIsolation isolation)
 
bool isReadOnly ()
 
void setReadOnly (bool readOnly)
 
bool getTrace ()
 
void setTrace (bool on)
 
ODBCXX_STRING getTraceFile ()
 
void setTraceFile (const ODBCXX_STRING &s)
 
DatabaseMetaDatagetMetaData ()
 
StatementcreateStatement ()
 
StatementcreateStatement (int resultSetType, int resultSetConcurrency)
 
PreparedStatementprepareStatement (const ODBCXX_STRING &sql)
 
PreparedStatementprepareStatement (const ODBCXX_STRING &sql, int resultSetType, int resultSetConcurrency)
 
CallableStatementprepareCall (const ODBCXX_STRING &sql)
 
CallableStatementprepareCall (const ODBCXX_STRING &sql, int resultSetType, int resultSetConcurrency)
 
ODBCXX_STRING nativeSQL (const ODBCXX_STRING &sql)
 
- Public Member Functions inherited from odbc::ErrorHandler
void clearWarnings ()
 
WarningListgetWarnings ()
 
virtual ~ErrorHandler ()
 

Private Member Functions

SQLUINTEGER _getNumericOption (SQLINTEGER optnum)
 
ODBCXX_STRING _getStringOption (SQLINTEGER optnum)
 
void _setNumericOption (SQLINTEGER optnum, SQLUINTEGER value)
 
void _setStringOption (SQLINTEGER optnum, const ODBCXX_STRING &value)
 
SQLHSTMT _allocStmt ()
 
 Connection (SQLHDBC h)
 
void _connect (const ODBCXX_STRING &dsn, const ODBCXX_STRING &user, const ODBCXX_STRING &password)
 
void _connect (const ODBCXX_STRING &connectString)
 
void _registerStatement (Statement *stmt)
 
void _unregisterStatement (Statement *stmt)
 
const DriverInfo_getDriverInfo () const
 

Private Attributes

PD * pd_
 
SQLHDBC hdbc_
 
DatabaseMetaDatametaData_
 
DriverInfodriverInfo_
 

Friends

class DriverManager
 
class Statement
 
class DatabaseMetaData
 
class DriverInfo
 

Additional Inherited Members

- Protected Member Functions inherited from odbc::ErrorHandler
void _postWarning (SQLWarning *w)
 
void _checkErrorODBC2 (SQLHENV henv, SQLHDBC hdbc, SQLHSTMT hstmt, SQLRETURN r, const ODBCXX_STRING &what)
 
void _checkStmtError (SQLHSTMT hstmt, SQLRETURN r, const char *what="")
 
void _checkConError (SQLHDBC hdbc, SQLRETURN r, const char *what="")
 
void _checkEnvError (SQLHENV henv, SQLRETURN r, const char *what="")
 
 ErrorHandler (bool collectWarnings=true)
 

Detailed Description

A database connection

Definition at line 38 of file connection.h.

View newest version in sPHENIX GitHub at line 38 of file connection.h

Member Enumeration Documentation

Transaction isolation constants.

Enumerator:
TRANSACTION_NONE 

The data source does not support transactions

TRANSACTION_READ_UNCOMMITTED 

Dirty reads, non-repeatable reads and phantom reads can occur.

TRANSACTION_READ_COMMITTED 

Non-repeatable and phantom reads can occur

TRANSACTION_REPEATABLE_READ 

Phantom reads can occur

TRANSACTION_SERIALIZABLE 

Simply no problems

Definition at line 81 of file connection.h.

View newest version in sPHENIX GitHub at line 81 of file connection.h

Constructor & Destructor Documentation

odbc::Connection::Connection ( SQLHDBC  h)
private
virtual odbc::Connection::~Connection ( )
virtual

Destructor. Closes the connection

Member Function Documentation

SQLHSTMT odbc::Connection::_allocStmt ( )
private
void odbc::Connection::_connect ( const ODBCXX_STRING dsn,
const ODBCXX_STRING user,
const ODBCXX_STRING password 
)
private
void odbc::Connection::_connect ( const ODBCXX_STRING connectString)
private
const DriverInfo* odbc::Connection::_getDriverInfo ( ) const
inlineprivate

Definition at line 74 of file connection.h.

View newest version in sPHENIX GitHub at line 74 of file connection.h

SQLUINTEGER odbc::Connection::_getNumericOption ( SQLINTEGER  optnum)
private
ODBCXX_STRING odbc::Connection::_getStringOption ( SQLINTEGER  optnum)
private
void odbc::Connection::_registerStatement ( Statement stmt)
private
void odbc::Connection::_setNumericOption ( SQLINTEGER  optnum,
SQLUINTEGER  value 
)
private
void odbc::Connection::_setStringOption ( SQLINTEGER  optnum,
const ODBCXX_STRING value 
)
private
void odbc::Connection::_unregisterStatement ( Statement stmt)
private
void odbc::Connection::commit ( )

Commits the ongoing transaction

Referenced by ODBCConnection::Commit().

+ Here is the caller graph for this function:

Statement* odbc::Connection::createStatement ( )

Creates a non-prepared statement

Referenced by OnCalServer::add_calibrator_to_statustable(), PktSizeDBodbc::AddRow(), OnlMonDBodbc::AddRow(), OnlMonClient::CacheRunDB(), OnlMonServer::CacheRunDB(), OnCalServer::check_calibrator_in_statustable(), OnCalServer::check_create_subsystable(), OnCalServer::check_create_successtable(), PktSizeDBodbc::CheckAndAddColumns(), OnlMonStatusDB::CheckAndCreateMonitor(), OnlMonStatusDB::CheckAndCreateTable(), PktSizeDBodbc::CheckAndCreateTable(), OnlMonDBodbc::CheckAndCreateTable(), OnCalServer::ClosestGoodRun(), OnCalServer::CreateCalibration(), ODBCConnection::CreateStatement(), OnlMonDBodbc::CreateTable(), FROG::dCacheSearch(), OnlMonDBodbc::DropTable(), OnlMonDBodbc::Dump(), OnlMonStatusDB::FindAndInsertRunNum(), OnCalServer::FindClosestCalibratedRun(), OnlMonStatusDB::findRunNumInDB(), OnCalServer::findRunNumInDB(), OnCalServer::FixMissingCalibration(), OnCalServer::GetCalibStatus(), OnCalDBodbc::GetLastCalibratedRun(), OnCalServer::GetLastGoodRunTS(), PktSizeDBodbc::GetPacketContent(), RunToTimePg::getRunNumber(), RunDBodbc::GetRunNumbers(), RunToTimePg::getTime(), OnlMonDBodbc::GetVar(), OnlMonDBodbc::Info(), OnCalServer::insertRunNumInDB(), FROG::LustreSearch(), FROG::MinIOSearch(), FROG::PGSearch(), RunDBodbc::RunType(), OnCalServer::SyncCalibTimeStampsToOnCal(), OnCalServer::SyncOncalTimeStampsToRunDB(), OnCalServer::updateDB(), OnCalServer::updateDBRunRange(), OnlMonStatusDB::UpdateStatus(), and FROG::XRootDSearch().

+ Here is the caller graph for this function:

Statement* odbc::Connection::createStatement ( int  resultSetType,
int  resultSetConcurrency 
)

Creates a non-prepared statement.

Parameters
resultSetTypeThe type for ResultSets created by this statement
resultSetConcurrencyThe concurrency for ResultSets created by this statement
bool odbc::Connection::getAutoCommit ( )

Returns true if autocommit is on

Referenced by ODBCConnection::GetAutoCommit().

+ Here is the caller graph for this function:

ODBCXX_STRING odbc::Connection::getCatalog ( )

Returns the current catalog

Referenced by OnlMonDBodbc::DropTable(), and ODBCConnection::GetCatalog().

+ Here is the caller graph for this function:

DatabaseMetaData* odbc::Connection::getMetaData ( )

Returns meta information for this connection.

Note that the returned object is 'owned' by this connection and should in no way be deleted by the caller.

Referenced by ClassImpQ(), OnlMonDBodbc::DropTable(), ODBCConnection::GetMetaData(), OnlMonDBodbc::Info(), and ODBCConnection::ODBCConnection().

+ Here is the caller graph for this function:

bool odbc::Connection::getTrace ( )

Returns true if ODBC tracing is enabled on this connection

Referenced by ODBCConnection::GetTrace().

+ Here is the caller graph for this function:

ODBCXX_STRING odbc::Connection::getTraceFile ( )

Returns the file ODBC tracing is currently written to

Referenced by ODBCConnection::GetTraceFile().

+ Here is the caller graph for this function:

TransactionIsolation odbc::Connection::getTransactionIsolation ( )

Returns the current transaction isolation level

Referenced by ODBCConnection::GetTransactionIsolation().

+ Here is the caller graph for this function:

bool odbc::Connection::isReadOnly ( )

Returns true if the connection is read only

Referenced by ODBCConnection::IsReadOnly().

+ Here is the caller graph for this function:

ODBCXX_STRING odbc::Connection::nativeSQL ( const ODBCXX_STRING sql)

Translate a given SQL string into this data sources' own SQL grammar.

Referenced by ODBCConnection::NativeSQL().

+ Here is the caller graph for this function:

CallableStatement* odbc::Connection::prepareCall ( const ODBCXX_STRING sql)

Create a callable prepared statement.

Parameters
sqlThe string to prepare, optionally containing parameter markers for input and/or output parameters

Referenced by ODBCConnection::PrepareCall().

+ Here is the caller graph for this function:

CallableStatement* odbc::Connection::prepareCall ( const ODBCXX_STRING sql,
int  resultSetType,
int  resultSetConcurrency 
)

Create a callable prepared statement.

Parameters
sqlThe string to prepare, optionally containing parameter markers for input and/or output parameters
resultSetTypeThe type for ResultSets created by this statement
resultSetConcurrencyThe concurrency for ResultSets created by this statement
PreparedStatement* odbc::Connection::prepareStatement ( const ODBCXX_STRING sql)

Create a prepared statement.

Parameters
sqlThe string to prepare, optionally containing parameter markers (?).

Referenced by ODBCConnection::PrepareStatement(), OnCalServer::SyncCalibTimeStampsToOnCal(), and OnCalServer::SyncOncalTimeStampsToRunDB().

+ Here is the caller graph for this function:

PreparedStatement* odbc::Connection::prepareStatement ( const ODBCXX_STRING sql,
int  resultSetType,
int  resultSetConcurrency 
)

Create a prepared statement.

Parameters
sqlThe string to prepare, optionally containing parameter markers.
resultSetTypeThe type for ResultSets created by this statement
resultSetConcurrencyThe concurrency for ResultSets created by this statement
void odbc::Connection::rollback ( )

Rollbacks the ongoing transaction

Referenced by ODBCConnection::Rollback().

+ Here is the caller graph for this function:

void odbc::Connection::setAutoCommit ( bool  autoCommit)

Sets the autocommit state of this connection

Parameters
autoCommittrue for on, false for off

Referenced by ODBCConnection::SetAutoCommit().

+ Here is the caller graph for this function:

void odbc::Connection::setCatalog ( const ODBCXX_STRING catalog)

Sets the current catalog

Referenced by ODBCConnection::SetCatalog().

+ Here is the caller graph for this function:

void odbc::Connection::setReadOnly ( bool  readOnly)

Sets the read-only state of this connection

Referenced by ODBCConnection::SetReadOnly().

+ Here is the caller graph for this function:

void odbc::Connection::setTrace ( bool  on)

Sets ODBC tracing on or off

Referenced by ODBCConnection::SetTrace().

+ Here is the caller graph for this function:

void odbc::Connection::setTraceFile ( const ODBCXX_STRING s)

Sets the file ODBC tracing is written to

Referenced by ODBCConnection::SetTraceFile().

+ Here is the caller graph for this function:

void odbc::Connection::setTransactionIsolation ( TransactionIsolation  isolation)

Sets the current transaction isolation level

Friends And Related Function Documentation

friend class DatabaseMetaData
friend

Definition at line 41 of file connection.h.

View newest version in sPHENIX GitHub at line 41 of file connection.h

friend class DriverInfo
friend

Definition at line 42 of file connection.h.

View newest version in sPHENIX GitHub at line 42 of file connection.h

friend class DriverManager
friend

Definition at line 39 of file connection.h.

View newest version in sPHENIX GitHub at line 39 of file connection.h

friend class Statement
friend

Definition at line 40 of file connection.h.

View newest version in sPHENIX GitHub at line 40 of file connection.h

Member Data Documentation

DriverInfo* odbc::Connection::driverInfo_
private

Definition at line 52 of file connection.h.

View newest version in sPHENIX GitHub at line 52 of file connection.h

SQLHDBC odbc::Connection::hdbc_
private

Definition at line 49 of file connection.h.

View newest version in sPHENIX GitHub at line 49 of file connection.h

DatabaseMetaData* odbc::Connection::metaData_
private

Definition at line 51 of file connection.h.

View newest version in sPHENIX GitHub at line 51 of file connection.h

PD* odbc::Connection::pd_
private

Definition at line 45 of file connection.h.

View newest version in sPHENIX GitHub at line 45 of file connection.h


The documentation for this class was generated from the following file: