dca_interface  6.3.4
dca::DbConnection Class Reference

#include <base_classes.h>

Detailed Description

Database connection class for a local or remote database.

Before a database can be used a connection to the database has to be established. This class is used to connect to a local or a remote database.

See also
DcaInstance::createDbConnection, DbConnectionData

Definition at line 858 of file base_classes.h.

Public Member Functions

std::string getDatabaseVersion () const
 Returns the currently used database version. More...
 
DatabaseInformation getDatabaseInformation () const
 Returns information about the underlying database. More...
 
LogLevel setLogLevel (LogLevel newLevel)
 Sets the logging level for the given class instance. The old value will be returned. More...
 

Member Function Documentation

◆ getDatabaseVersion()

std::string dca::DbConnection::getDatabaseVersion ( ) const

Returns the currently used database version.

If the DbConnection is valid and connected to a database this is the version of the database. The format is <major>.<minor>
Where major is a number usually 6 for local databases and 5 or 6 for remote databases and minor is a 8-digit number with leading 0's
Examples:
local: "6.00012345" remote "5.00023478"

Returns
The version string of the connected database or an empty string if not connected
Note
When using a local database the string returns the version of the newest used update file that is not neccessarily been merged into a database file but already used.

◆ getDatabaseInformation()

DatabaseInformation dca::DbConnection::getDatabaseInformation ( ) const

Returns information about the underlying database.

See also
dca::DatabaseInformation
Returns
aDatabaseInformation The struct to contain database information
Exceptions
Anexception of type ExDca is thrown if this function fails e.g. the DbConnection object isn't initialized before.

◆ setLogLevel()

LogLevel dca::DbConnection::setLogLevel ( LogLevel  newLevel)

Sets the logging level for the given class instance. The old value will be returned.

Usually the logging level is set to LOG_Notice.

Parameters
[in]newLevelThe new LogLevel the class instance should use for logging
Returns
The old used logging level.

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