![]() |
MAK Data Logger API Documentation for DIS
|
DtDatabaseInterface is an interface object accessing and modifying a database. More...
Collaboration diagram for DtDatabaseInterface:Public Types | |
| enum | ConditionOperator { Equals, NotEquals } |
| enum | MergeOperator { And, Or } |
Public Member Functions | |
| DtDatabaseInterface (const DtDatabaseDriver *databaseDriver) | |
| Constructor. | |
| virtual | ~DtDatabaseInterface () |
| Destructor. | |
| DtDatabaseParameters * | createDefaultParameters () const |
| Create the default parameters. | |
| virtual bool | connect (DtDatabaseParameters *params, bool useMaster) |
| Connect to a database through the given DSN as userName (Note: if we want to support real user acts on the database server, this will need to be extended to include a password as well. | |
| virtual bool | disconnect () |
| Disconnect from the currently connected database. | |
| virtual unsigned int | maximumColumnWidth () |
| Get the current maximum supported column width. | |
| virtual bool | executeCommand (const DtString &sqlCommand) |
| Execute the given SQL command. | |
| virtual bool | createDatabase (const DtString &databaseName) |
| Request the creation of a database (currently, you must be connected to a master database to perform this operation) | |
| virtual bool | deleteDatabase (const DtString &databaseName) |
| Request the creation of a database, if it exists (currently, you must be connected to a master database to perform this operation) | |
| virtual bool | createDataSourceName (DtDatabaseParameters *params, bool useMaster) |
| Create a DSN. | |
| virtual bool | createTable (const DtDatabaseTable &tableDef, bool deleteIfExists) |
| Create a table in the currently connected database as described by tableDef. | |
| virtual bool | insertRow (const DtDatabaseTable &tableDef) |
| Insert the row of data currently contained in tableDef. | |
| virtual bool | updateRow (const DtDatabaseTable &tableDef, const std::vector< DtString > &columnsToSet, const DtString &whereCondition) |
| Update a row using the table settings, the columns to set, and the condition. | |
| virtual DtString | createConditionString (const DtDatabaseColumn &column, const DtString &columnValue, ConditionOperator anOperator) |
| Generate a condition string from a column and a value. | |
| virtual DtString | combineConditionStrings (const DtString &conditionOne, const DtString &conditionTwo, MergeOperator anOperator) |
| Generate a condition string from two existing conditions. | |
| void | setIsMasterDSN (bool yesNo) |
| Set/Get the current value of the "Is Master DSN" flag. | |
| bool | isMasterDSN () const |
| void | setCreateDsnFailed (bool yesNo) |
| Set/Get the current value of the "Create DSN Failed" flag. | |
| bool | createDsnFailed () const |
Protected Attributes | |
| const DtDatabaseDriver * | myDriver |
| DtDatabaseEnvironment * | myEnvironment |
| DtDatabaseConnection * | myConnection |
| DtDatabaseCommandProcessor * | myCommandProcessor |
| DtDatabaseCommandFactory * | myCommandFactory |
| bool | myIsMaster |
| Did we create the environment and connection objects? | |
| bool | myCreateDsnFailed |
DtDatabaseInterface is an interface object accessing and modifying a database.
|
explicit |
Constructor.
| DtInvalidInput,if | the database driver is null. |
|
virtual |
Destructor.
|
virtual |
Generate a condition string from two existing conditions.
|
virtual |
Connect to a database through the given DSN as userName (Note: if we want to support real user acts on the database server, this will need to be extended to include a password as well.
Username and passwd could be command line args or mtl parameters (?))
|
virtual |
Generate a condition string from a column and a value.
|
virtual |
Request the creation of a database (currently, you must be connected to a master database to perform this operation)
|
virtual |
Create a DSN.
Note that both the DSN and database name are in the config strings, which are ODBC driver-type specific.
| DtDatabaseParameters* DtDatabaseInterface::createDefaultParameters | ( | ) | const |
Create the default parameters.
| bool DtDatabaseInterface::createDsnFailed | ( | ) | const |
|
virtual |
Create a table in the currently connected database as described by tableDef.
|
virtual |
Request the creation of a database, if it exists (currently, you must be connected to a master database to perform this operation)
|
virtual |
Disconnect from the currently connected database.
|
virtual |
Execute the given SQL command.
|
virtual |
Insert the row of data currently contained in tableDef.
If not called with a table argument that implements something useful for genValueString(), this will probably result in an SQL error
| bool DtDatabaseInterface::isMasterDSN | ( | ) | const |
|
virtual |
Get the current maximum supported column width.
| void DtDatabaseInterface::setCreateDsnFailed | ( | bool | yesNo | ) |
Set/Get the current value of the "Create DSN Failed" flag.
| void DtDatabaseInterface::setIsMasterDSN | ( | bool | yesNo | ) |
Set/Get the current value of the "Is Master DSN" flag.
|
virtual |
Update a row using the table settings, the columns to set, and the condition.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Did we create the environment and connection objects?