C++ Client API 1.4 (November 2023)
 
Loading...
Searching...
No Matches
dbSpaces::dbcli::Environment Class Reference

#include <Ccdb_Environment.h>

Inheritance diagram for dbSpaces::dbcli::Environment:
Collaboration diagram for dbSpaces::dbcli::Environment:

Public Member Functions

 Environment ()
 
 Environment (dtLARGE argc, dtSTRING *argv[])
 
 ~Environment ()
 
ConnectionCreateConnection ()
 
const dtSTRING * GetDataSourceIniFile ()
 
const dtSTRING * GetProgramName ()
 
const dtBOOLEAN IsExceptionsEnabled ()
 
void SetExceptionsEnabled (const dtBOOLEAN)
 
dtRtnStatus SetDataSourceIniFile (const dtSTRING *)
 
void SetProgramName (const dtSTRING *)
 
- Public Member Functions inherited from dbSpaces::dbcli::cdbBase
 cdbBase (cdbBase *, ccdbClassType, dtBOOLEAN=TRUE)
 
virtual ~cdbBase ()
 
cdb_childList_t & GetChildList ()
 
Ccoms_CommsManager * GetTransportComms ()
 
ccdbClassType GetType ()
 
void SetTransportComms (Ccoms_CommsManager *)
 

Detailed Description

The Environment object holds environment information for the database client. The Environment object is the main object in the client database API and is used to create a Connection object that allows you to connect to the database server.

A DatabaseException will be thrown if a database error occurs and exceptions are enabled. If exceptions are not enabled the following error methods can be used to get information about the error;

  • GetErrorStatus()
  • GetErrorCode()
  • GetErrorMessage()
Since
Version 1.0

Constructor & Destructor Documentation

◆ Environment() [1/2]

dbSpaces::dbcli::Environment::Environment ( )

Environment default constructor.

Since
Version 1.0

◆ Environment() [2/2]

dbSpaces::dbcli::Environment::Environment ( dtLARGE  argc,
dtSTRING *  argv[] 
)

Environment constructor passing in run-time arguments.

Parameters
argcThe number of arguments.
argvThe array of arguments.
Since
Version 1.0

◆ ~Environment()

dbSpaces::dbcli::Environment::~Environment ( )

Environment default destructor.

Since
Version 1.0

Member Function Documentation

◆ CreateConnection()

Connection * dbSpaces::dbcli::Environment::CreateConnection ( )

Create a new Connection object.

Returns
The new Connection object.
Since
Version 1.0

◆ GetDataSourceIniFile()

const dtSTRING * dbSpaces::dbcli::Environment::GetDataSourceIniFile ( )

Get the data source ini file name.

Returns
The ini file name.
Since
Version 1.0

◆ GetProgramName()

const dtSTRING * dbSpaces::dbcli::Environment::GetProgramName ( )

Get the program name.

Returns
The Program name.
Since
Version 1.0

◆ IsExceptionsEnabled()

const dtBOOLEAN dbSpaces::dbcli::Environment::IsExceptionsEnabled ( )

Are error exceptions enabled?

Returns
TRUE if exceptions are enabled; FALSE if otherwise.
Since
Version 1.0

◆ SetDataSourceIniFile()

dtRtnStatus dbSpaces::dbcli::Environment::SetDataSourceIniFile ( const dtSTRING *  )

Set the data source ini file for the environment. The ini file should exist in the dbSpaces system directory.

Parameters
iniFileNameThe name of the ini file to use.
Returns
RTN_STATUS_SUCCESS or RTN_STATUS_ERROR.
Exceptions
DatabaseException(if exceptions are enabled) when a database error occurs.
Since
Version 1.0

◆ SetExceptionsEnabled()

void dbSpaces::dbcli::Environment::SetExceptionsEnabled ( const  dtBOOLEAN)

Set whether the system throws exceptions when there is an error. If exceptions are not thrown you will need to check the error state.

Parameters
stateTRUE if exceptions are to be thrown, otherwise FALSE.
Since
Version 1.0

◆ SetProgramName()

void dbSpaces::dbcli::Environment::SetProgramName ( const dtSTRING *  )

Set the program name to identify the connection by in the server.

Parameters
nameThe Program name.
Since
Version 1.0