Db Class Reference

Base class for all databases. More...

#include <CifSchemaMap.h>

Inherited by DbDb2, DbMySql, DbOracle, and DbSybase.

Inheritance diagram for Db:

Inheritance graph
[legend]
Collaboration diagram for Db:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Db (SchemaMapping &schemaMapping, const string &dbName=DB_DEFAULT_NAME)
virtual ~Db ()
void SetUseOnlyPopulated (bool mode=true)
bool GetUseOnlyPopulated ()
void SetAppendFlag (const bool appendFlag)
bool GetAppendFlag ()
void SetFieldSeparator (const string &fieldSeparator)
void SetRowSeparator (const string &rowSeparator)
string GetCommandTerm ()
string GetFieldSeparator ()
string GetRowSeparator ()
virtual void GetStart (string &start)
virtual void WriteSchemaStart (ostream &io)
void WriteDeleteTable (ostream &io, const string &table, const string &where, const string &what)
virtual void DropTableSql (ostream &io, const string &tableNameDb)
virtual const string & GetExec ()
virtual const string & GetExecOption ()
virtual const string & GetUserOption ()
virtual const string & GetPassOption ()
virtual const string & GetEnvDbUser ()
virtual const string & GetEnvDbPass ()
virtual const string & GetConnect ()
virtual const string & GetTerminate ()
virtual const string & GetDbCommand ()
virtual void WriteLoad (ostream &io)
const string & GetDataLoadingFileName ()
virtual void WriteLoadingStart (ostream &io)
virtual void WriteLoadingEnd (ostream &io)
virtual void WriteLoadingTable (ostream &io, const string &tableName, const string &path)
virtual void WritePrint (ostream &io, const string &tableNameDb)
virtual void GetChar (string &dType, const unsigned int width)
virtual void GetFloat (string &dType)
virtual void GetText (string &dType, const unsigned int width)
virtual void GetDate (string &dType)
virtual void WriteNull (ostream &io, const int iNull, const unsigned int curr, const unsigned int attSize)
virtual void WriteTableIndex (ostream &io, const string &tableNameDb, const vector< string > &indexList)
const string & GetBcpStringDelimiter ()
virtual void WriteBcpDoubleQuotes (ostream &io)
virtual void WriteNewLine (ostream &io, bool special=false)
bool IsFirstTextNewLineSpecial ()
virtual void ConvertDate (string &dbDate, const string &cifDate)
virtual void ConvertTimestamp (string &dbTimestamp, const string &cifTimestamp)

Public Attributes

SchemaMapping_schemaMapping

Static Public Attributes

static const string DB_DEFAULT_NAME

Protected Attributes

bool _useOnlyPopulated
bool _appendFlag
string _fieldSeparator
string _rowSeparator
string _cmdTerm
string _dbName
string _exec
string _execOption
string _userOption
string _passOption
string _connect
string _terminate
string _dbCommand
string _envDbUser
string _envDbPass
string _dataLoadingFileName
string _bcpStringDelimiter
bool _firstTextNewLineSpecial

Static Private Attributes

static const string _SCRIPT_LOADING_FILE

Detailed Description

Base class for all databases.

This class encapsulates general characteristics of each database. It contains methods for generic database related operations and virtual methods, that are to be specialized in concrete databases.


Constructor & Destructor Documentation

Db::Db ( SchemaMapping schemaMapping,
const string &  dbName = DB_DEFAULT_NAME 
)

Db::~Db (  )  [virtual]


Member Function Documentation

void Db::SetUseOnlyPopulated ( bool  mode = true  ) 

bool Db::GetUseOnlyPopulated (  ) 

void Db::SetAppendFlag ( const bool  appendFlag  ) 

bool Db::GetAppendFlag (  ) 

void Db::SetFieldSeparator ( const string &  fieldSeparator  ) 

void Db::SetRowSeparator ( const string &  rowSeparator  ) 

string Db::GetCommandTerm (  ) 

string Db::GetFieldSeparator (  ) 

string Db::GetRowSeparator (  ) 

void Db::GetStart ( string &  start  )  [virtual]

Reimplemented in DbDb2, DbMySql, and DbSybase.

void Db::WriteSchemaStart ( ostream &  io  )  [virtual]

Reimplemented in DbOracle, and DbDb2.

void Db::WriteDeleteTable ( ostream &  io,
const string &  table,
const string &  where,
const string &  what 
)

void Db::DropTableSql ( ostream &  io,
const string &  tableNameDb 
) [virtual]

Reimplemented in DbMySql.

const string & Db::GetExec (  )  [virtual]

const string & Db::GetExecOption (  )  [virtual]

const string & Db::GetUserOption (  )  [virtual]

const string & Db::GetPassOption (  )  [virtual]

const string & Db::GetEnvDbUser (  )  [virtual]

const string & Db::GetEnvDbPass (  )  [virtual]

const string & Db::GetConnect (  )  [virtual]

const string & Db::GetTerminate (  )  [virtual]

const string & Db::GetDbCommand (  )  [virtual]

void Db::WriteLoad ( ostream &  io  )  [virtual]

Reimplemented in DbMySql.

const string & Db::GetDataLoadingFileName (  ) 

void Db::WriteLoadingStart ( ostream &  io  )  [virtual]

Reimplemented in DbOracle, DbDb2, DbMySql, and DbSybase.

void Db::WriteLoadingEnd ( ostream &  io  )  [virtual]

Reimplemented in DbDb2.

void Db::WriteLoadingTable ( ostream &  io,
const string &  tableName,
const string &  path 
) [virtual]

Reimplemented in DbOracle, DbDb2, DbMySql, and DbSybase.

void Db::WritePrint ( ostream &  io,
const string &  tableNameDb 
) [virtual]

Reimplemented in DbSybase.

void Db::GetChar ( string &  dType,
const unsigned int  width 
) [virtual]

void Db::GetFloat ( string &  dType  )  [virtual]

Reimplemented in DbDb2.

void Db::GetText ( string &  dType,
const unsigned int  width 
) [virtual]

Reimplemented in DbOracle, and DbDb2.

void Db::GetDate ( string &  dType  )  [virtual]

Reimplemented in DbOracle, and DbDb2.

void Db::WriteNull ( ostream &  io,
const int  iNull,
const unsigned int  curr,
const unsigned int  attSize 
) [virtual]

Reimplemented in DbOracle, DbDb2, DbMySql, and DbSybase.

void Db::WriteTableIndex ( ostream &  io,
const string &  tableNameDb,
const vector< string > &  indexList 
) [virtual]

Reimplemented in DbOracle, DbDb2, DbMySql, and DbSybase.

const string & Db::GetBcpStringDelimiter (  ) 

void Db::WriteBcpDoubleQuotes ( ostream &  io  )  [virtual]

Reimplemented in DbDb2.

void Db::WriteNewLine ( ostream &  io,
bool  special = false 
) [virtual]

Reimplemented in DbOracle, and DbMySql.

bool Db::IsFirstTextNewLineSpecial (  ) 

void Db::ConvertDate ( string &  dbDate,
const string &  cifDate 
) [virtual]

void Db::ConvertTimestamp ( string &  dbTimestamp,
const string &  cifTimestamp 
) [virtual]


Member Data Documentation

const string Db::DB_DEFAULT_NAME [static]

SchemaMapping& Db::_schemaMapping

bool Db::_useOnlyPopulated [protected]

bool Db::_appendFlag [protected]

string Db::_fieldSeparator [protected]

string Db::_rowSeparator [protected]

string Db::_cmdTerm [protected]

string Db::_dbName [protected]

string Db::_exec [protected]

string Db::_execOption [protected]

string Db::_userOption [protected]

string Db::_passOption [protected]

string Db::_connect [protected]

string Db::_terminate [protected]

string Db::_dbCommand [protected]

string Db::_envDbUser [protected]

string Db::_envDbPass [protected]

string Db::_dataLoadingFileName [protected]

string Db::_bcpStringDelimiter [protected]

bool Db::_firstTextNewLineSpecial [protected]

const string Db::_SCRIPT_LOADING_FILE [static, private]


The documentation for this class was generated from the following files:
Generated on Fri Feb 8 10:24:43 2008 for db-loader-v4.0 by  doxygen 1.5.1