class HDbFileIo: public TObject

_HADES_CLASS_DESCRIPTION

 HDbFileIo

 Oracle I/O class to load data from a client-side file into an Oracle table
 or to write data from an Oracle table to a client-side file
 (uses the Oracle C/C++ precompiler)

 Description  of the program:
      http://www-hades.gsi.de/persons/ilse/orafileio.htm


Function Members (Methods)

public:
HDbFileIo()
HDbFileIo(const HDbFileIo&)
virtual~HDbFileIo()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
voidclear()
virtual voidTObject::Clear(Option_t* = "")
virtual TObject*TObject::Clone(const char* newname = "") const
voidcloseDbConn()
voidcloseFile()
voidcommit()
virtual Int_tTObject::Compare(const TObject* obj) const
Bool_tconnectDb(TString, TString dbName = "db-hades")
virtual voidTObject::Copy(TObject& object) const
Bool_tdbIsOpen()
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
voiddropTemporaryTable(const Char_t*)
voiddropTemporaryTables()
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
Bool_tfileIsOpen()
Bool_tfileIsWritable()
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
Bool_tgetAutoCommit()
Bool_tgetAutoNull()
const Char_t*getColumnDelimiter()
HDbTable*getCurTable()
const Char_t*getDateMask()
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual const char*TObject::GetIconName() const
virtual const char*TObject::GetName() const
const Char_t*getNullValue() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
HDbTable*getTempTable(const Char_t*)
const Char_tgetTextDelimiter()
virtual const char*TObject::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTObject::ls(Option_t* option = "") const
Bool_tmakeInsert(const Char_t*, const Char_t*)
Bool_tmakeUpdate(const Char_t*, const Char_t*)
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
Bool_topenFile(const Char_t*, const Char_t*)
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
HDbFileIo&operator=(const HDbFileIo&)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidTObject::Print(Option_t* option = "") const
Bool_tprintResult()
virtual Int_tTObject::Read(const char* name)
Bool_treadFile(Int_t nLineStart = 1, Int_t nLineEnd = 999999)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
voidrollback()
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(basic_ostream<char,char_traits<char> >& out, Option_t* option = "")
voidsetAutoCommit(Bool_t b)
voidsetAutoNull(Bool_t b = kTRUE)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
voidsetColumnDelimiter(const Char_t* s = " ")
Bool_tsetDateMask(const Char_t* mask = "DD-MON-YYYY HH24:MI:SS")
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
voidsetNullValue(const Char_t* s = "null")
static voidTObject::SetObjectStat(Bool_t stat)
Bool_tsetRun(const Char_t* daqFile)
Bool_tsetSearchDate(const Char_t* time = "sysdate")
HDbTable*setTableName(const Char_t*)
voidsetTextDelimiter(const Char_t s)
virtual voidTObject::SetUniqueID(UInt_t uid)
voidshowExistingTable()
virtual voidShowMembers(TMemberInspector& insp, char* parent)
voidshowSettings()
voidshowTemporaryTables()
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
Bool_twriteFile()
protected:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()
private:
voidaddTempTable(HDbTable* table)
voidcheckCommit()
Int_tcheckTable(TString&)
voidconfirmCommit()
TStringgetActDate()
Int_tgetValues(TString&, Int_t)
Bool_topenInput(const Char_t*)
Bool_topenOutput(const Char_t*, const Char_t*)
voidremoveTempTable(HDbTable* table)
Bool_twrite(ostream&)

Data Members

public:
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
private:
TStringactDateMaskActual date format
Bool_tautoCommitFlag (if kTRUE, a transaction is committed automatically)
Bool_tautoNullFlag (if kTRUE, null values are added automatically)
TStringcolDelimDelimiter between columns in the file
HDbTable*curTablePointer to a table form for I/O
HDbConn*dbConnPointer to the Oracle connection class
HDbFileUtil*dbUtilPointer to the Oracle utility class
TStringdefTableNameDefault table name (generated from filename)
ifstream*finPointer to an input filestream
ofstream*foutPointer to an output filestream
Int_tmaxBufLenMaximum length of the I/O buffer (4000 bytes)
Int_tmaxStmLenMaximum length of the insert statement (about 8000 bytes)
Bool_tneedsCommitFlag (is kTRUE, when inserts/updates where not yet committed)
TStringnullValueIdentifier for a null value in a column
HDbTable*refTablePointer to an existing table
TList*tempTablesList of temporary tables created in the current session
TStringtextDelimEnclosing delimiter for text in a single column

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

HDbFileIo()
 Constructor creates the Oracle connection class, but does not open a connection
~HDbFileIo()
 Destructor closes the Oracle connection and a file not yet closed
Bool_t connectDb(TString , TString dbName = "db-hades")
 Opens an Oracle connection (e.g.with:  "hades","db-hades")
void closeDbConn()
 Closes the Oracle connection
 Asks for committing all not yet saved transactions
Bool_t openFile(const Char_t* , const Char_t* )
 Closes an open file and opens the new file
 Possible I/O modes are "in", "out", "app"
void closeFile()
 Closes the file
Bool_t fileIsOpen()
 Returns kTRUE in case the file is open
Bool_t fileIsWritable()
 Returns kTRUE in case the file is writable
HDbTable* setTableName(const Char_t* )
 Sets the name of the Oracle table.
 Checks if a table with this name exists already.
 Returns a pointer to a table.
 For an existing table this form contains all columns of this table. If the
 table does not exist the list of columns is empty. This table can be used
 to define the columns for an insert/update.
 (You can call the HDbTable::clear() function to remove all columns from the
 list. Then all or only some columns can be added again in the order needed
 for the file I/O.)
void setColumnDelimiter(const Char_t* s = " ")
 Sets the delimiter beween columns (default value: " ")
Bool_t setDateMask(const Char_t* mask = "DD-MON-YYYY HH24:MI:SS")
 Sets a date mask in Oracle
Bool_t setSearchDate(const Char_t* time = "sysdate")
 Sets the search date in Oracle used to select data from views which
 require a date specified before retrieving results.
 The default value is the actual time on the server.
Bool_t setRun(const Char_t* daqFile)
 Sets the run in Oracle used to select data from views which require
 a run specified before retrieving results.
HDbTable* getTempTable(const Char_t* )
 Returns a pointer to a temporary table created inside the current
 Oracle session
void showTemporaryTables()
 Shows all temporary tables created inside the current Oracle session
void dropTemporaryTable(const Char_t* )
 Drops a temporary table created inside the current Oracle session.
 Each Drop must be confirmed.
void dropTemporaryTables()
 Drops all temporary tables created inside the current Oracle session.
 Each Drop must be confirmed.
void commit(void)
 Commits Oracle transactions
void rollback(void)
 Rolls back Oracle transactions
void showExistingTable()
 Shows the table definition of the existing table
void clear()
 Deletes the actual table objects curTable and refTable
void showSettings()
 Shows the actual parameter settings for the I/O
Bool_t readFile(Int_t nLineStart = 1, Int_t nLineEnd = 999999)
 Reads a file starting at line nLineStart( default 1) and stopping after
 line nLineEnd (default 999999) or EOF and inserts the data into an Oracle
 table. Inserts into an existing table must be confirmed.
 When the name of the table was not set before, a default table name is
 generated from the filename. The creation of a temporary table must be
 confirmed.
 The file is not closed automatically.
Bool_t makeInsert(const Char_t* , const Char_t* )
 Inserts one row in the actual table
 colNames:  comma separated list of columns;
            use "*" for an insert with values for all columns
 colValues: comma separated list of values for the columns
Bool_t makeUpdate(const Char_t* , const Char_t* )
 Updates one or more rows in a temporary table
 setVal   : SET part of an update statement (col1=val1, col2=val2, ...)
 condition: Condition for the columns to be updated
            WARNING: An empty condition will update all columns!
Bool_t writeFile()
 Writes the data from an Oracle table into a file
Bool_t printResult()
 Prints the data from an Oracle table on the screen
Bool_t openInput(const Char_t* )
 Opens a file for input and generates the default table name
Bool_t openOutput(const Char_t* , const Char_t* )
 Opens a file for output
Int_t checkTable(TString& )
 Sets the default table name and table definition if necessary. Checks if
 the table exists and creates it otherwise. A newly created table is added
 in the list of temporary tables.
void addTempTable(HDbTable* table)
 Adds a temporary table to the list of temporary tables
void removeTempTable(HDbTable* table)
 Removes a table from the list of temporary tables and deletes it.
 Deletes also the actual tables when they have identical names.
Int_t getValues(TString& , Int_t )
 Gets the column values from a line read from file
Bool_t write(ostream& )
 Writes the table content to a file or to stdout
TString getActDate()
 Returns the actual date and time
void checkCommit()
 Calls commit() when flag autoCommit is kTRUE
void confirmCommit()
 Ask to confirm uncommitted transactions
HDbFileIo()
Bool_t dbIsOpen()
{return dbConn->isOpen(); }
void setTextDelimiter(const Char_t s)
{ textDelim[0]=s; }
void setNullValue(const Char_t* s = "null")
{ nullValue=s; }
void setAutoCommit(Bool_t b)
{ autoCommit=b; }
void setAutoNull(Bool_t b = kTRUE)
{ autoNull=b; }
HDbTable* getCurTable()
{ return curTable; }
const Char_t* getColumnDelimiter()
{ return colDelim.Data(); }
const Char_t getTextDelimiter()
{ return textDelim[0]; }
const Char_t* getNullValue() const
{ return nullValue.Data(); }
Bool_t getAutoCommit()
{ return autoCommit; }
Bool_t getAutoNull()
{ return autoNull; }
const Char_t* getDateMask()
{ return actDateMask.Data(); }

Last change: Sat May 22 12:54:30 2010
Last generated: 2010-05-22 12:54

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.