OpenPetra
Free Administration Software for Non-Profits
Ict.Common.DB.IDataBaseRDBMS Interface Reference

every database system that works for OpenPetra has to implement these functions More...

Inheritance diagram for Ict.Common.DB.IDataBaseRDBMS:
Ict.Common.DB.TMySQL Ict.Common.DB.TPostgreSQL

Public Member Functions

DbConnection GetConnection (String AServer, String APort, String ADatabaseName, String AUsername, ref String APassword, ref String AConnectionString, StateChangeEventHandler AStateChangeEventHandler)
 Creates a connection to a RDBMS, but does not open it yet. More...
 
void InitConnection (DbConnection AConnection)
 init the connection after it was opened More...
 
bool LogException (Exception AException, ref string AErrorMessage)
 this is for special Exceptions that are specific to the database they are converted to a string message for logging More...
 
String FormatQueryRDBMSSpecific (String ASqlQuery)
 Formats a SQL query for a specific RDBMS. Put the Schema specifier in front of table names! Format: PUB_* (eg. PUB_p_partner). More...
 
DbParameter[] ConvertOdbcParameters (DbParameter[] AParameterArray, ref string ASqlStatement)
 convert the ODBC More...
 
DbCommand NewCommand (ref string ACommandText, DbConnection AConnection, DbParameter[] AParametersArray, TDBTransaction ATransaction)
 Creates a DbCommand object. This formats the sql query for the database, and transforms the parameters. More...
 
DbDataAdapter NewAdapter ()
 Creates a DbDataAdapter object. More...
 
void FillAdapter (DbDataAdapter TheAdapter, ref DataSet AFillDataSet, Int32 AStartRecord, Int32 AMaxRecords, string ADataTableName)
 Fills a DbDataAdapter that was created with the NewAdapter Method. More...
 
void FillAdapter (DbDataAdapter TheAdapter, ref DataTable AFillDataTable, Int32 AStartRecord, Int32 AMaxRecords)
 Fills a DbDataAdapter that was created with the NewAdapter Method. More...
 
bool AdjustIsolationLevel (ref IsolationLevel AIsolationLevel)
 some databases have some problems with certain Isolation levels More...
 
System.Int64 GetNextSequenceValue (String ASequenceName, TDBTransaction ATransaction, TDataBase ADatabase)
 Returns the next sequence value for the given Sequence from the DB. More...
 
System.Int64 GetCurrentSequenceValue (String ASequenceName, TDBTransaction ATransaction, TDataBase ADatabase)
 Returns the current sequence value for the given Sequence from the DB. More...
 
void RestartSequence (String ASequenceName, TDBTransaction ATransaction, TDataBase ADatabase, Int64 ARestartValue)
 restart a sequence with the given value More...
 
void ClearConnectionPool (DbConnection ADBConnection)
 Clears (empties) the Connection Pool that a RDBMS driver provides for all connections that were created using the Connection String that is associated with ADBConnection . In case an RDBMS type doesn't provide a Connection Pool nothing is done and the Method returns no error. More...
 

Detailed Description

every database system that works for OpenPetra has to implement these functions

Member Function Documentation

◆ AdjustIsolationLevel()

bool Ict.Common.DB.IDataBaseRDBMS.AdjustIsolationLevel ( ref IsolationLevel  AIsolationLevel)

some databases have some problems with certain Isolation levels

Parameters
AIsolationLevel
Returns
true if isolation level was modified

Implemented in Ict.Common.DB.TMySQL, and Ict.Common.DB.TPostgreSQL.

◆ ClearConnectionPool()

void Ict.Common.DB.IDataBaseRDBMS.ClearConnectionPool ( DbConnection  ADBConnection)

Clears (empties) the Connection Pool that a RDBMS driver provides for all connections that were created using the Connection String that is associated with ADBConnection . In case an RDBMS type doesn't provide a Connection Pool nothing is done and the Method returns no error.

THERE IS NORMALLY NO NEED TO EXECUTE THIS METHOD - IN FACT THIS METHOD SHOULD NOT GET CALLED as it will have a negative performance impact when subsequent DB Connections are opened! Use this Method only for 'unit-testing' DB Connection-related issues (such as that DB Connections are really closed when they ought to be).

Implemented in Ict.Common.DB.TMySQL, and Ict.Common.DB.TPostgreSQL.

◆ ConvertOdbcParameters()

DbParameter[] Ict.Common.DB.IDataBaseRDBMS.ConvertOdbcParameters ( DbParameter[]  AParameterArray,
ref string  ASqlStatement 
)

convert the ODBC

Parameters
AParameterArray
ASqlStatement
Returns

Implemented in Ict.Common.DB.TMySQL, and Ict.Common.DB.TPostgreSQL.

◆ FillAdapter() [1/2]

void Ict.Common.DB.IDataBaseRDBMS.FillAdapter ( DbDataAdapter  TheAdapter,
ref DataSet  AFillDataSet,
Int32  AStartRecord,
Int32  AMaxRecords,
string  ADataTableName 
)

Fills a DbDataAdapter that was created with the NewAdapter Method.

Parameters
TheAdapter
AFillDataSet
AStartRecord
AMaxRecords
ADataTableName

Implemented in Ict.Common.DB.TMySQL, and Ict.Common.DB.TPostgreSQL.

◆ FillAdapter() [2/2]

void Ict.Common.DB.IDataBaseRDBMS.FillAdapter ( DbDataAdapter  TheAdapter,
ref DataTable  AFillDataTable,
Int32  AStartRecord,
Int32  AMaxRecords 
)

Fills a DbDataAdapter that was created with the NewAdapter Method.

Overload of FillAdapter, just for one table.

Parameters
TheAdapter
AFillDataTable
AStartRecord
AMaxRecords

Implemented in Ict.Common.DB.TMySQL, and Ict.Common.DB.TPostgreSQL.

◆ FormatQueryRDBMSSpecific()

String Ict.Common.DB.IDataBaseRDBMS.FormatQueryRDBMSSpecific ( String  ASqlQuery)

Formats a SQL query for a specific RDBMS. Put the Schema specifier in front of table names! Format: PUB_* (eg. PUB_p_partner).

Always use ANSI SQL-92 commands that are understood by all RDBMS systems that should be supported - this does no 'translation' of the SQL commands!

Parameters
ASqlQuerySQL query
Returns
SQL query that is formatted for a specific RDBMS.

Implemented in Ict.Common.DB.TMySQL, and Ict.Common.DB.TPostgreSQL.

◆ GetConnection()

DbConnection Ict.Common.DB.IDataBaseRDBMS.GetConnection ( String  AServer,
String  APort,
String  ADatabaseName,
String  AUsername,
ref String  APassword,
ref String  AConnectionString,
StateChangeEventHandler  AStateChangeEventHandler 
)

Creates a connection to a RDBMS, but does not open it yet.

Parameters
AServer
APort
ADatabaseName
AUsername
APassword
AConnectionString
AStateChangeEventHandler
Returns
Instantiated object (derived from DbConnection) - its actual Type depends on the RDBMS that we are connected to at runtime!

Implemented in Ict.Common.DB.TMySQL, and Ict.Common.DB.TPostgreSQL.

◆ GetCurrentSequenceValue()

System.Int64 Ict.Common.DB.IDataBaseRDBMS.GetCurrentSequenceValue ( String  ASequenceName,
TDBTransaction  ATransaction,
TDataBase  ADatabase 
)

Returns the current sequence value for the given Sequence from the DB.

Parameters
ASequenceNameName of the Sequence.
ATransactionAn instantiated Transaction in which the Query to the DB will be enlisted.
ADatabasethe database object that can be used for querying
Returns
Sequence Value.

Implemented in Ict.Common.DB.TMySQL, and Ict.Common.DB.TPostgreSQL.

◆ GetNextSequenceValue()

System.Int64 Ict.Common.DB.IDataBaseRDBMS.GetNextSequenceValue ( String  ASequenceName,
TDBTransaction  ATransaction,
TDataBase  ADatabase 
)

Returns the next sequence value for the given Sequence from the DB.

Parameters
ASequenceNameName of the Sequence.
ATransactionAn instantiated Transaction in which the Query to the DB will be enlisted.
ADatabasethe database object that can be used for querying
Returns
Sequence Value.

Implemented in Ict.Common.DB.TMySQL, and Ict.Common.DB.TPostgreSQL.

◆ InitConnection()

void Ict.Common.DB.IDataBaseRDBMS.InitConnection ( DbConnection  AConnection)

init the connection after it was opened

Implemented in Ict.Common.DB.TMySQL, and Ict.Common.DB.TPostgreSQL.

◆ LogException()

bool Ict.Common.DB.IDataBaseRDBMS.LogException ( Exception  AException,
ref string  AErrorMessage 
)

this is for special Exceptions that are specific to the database they are converted to a string message for logging

Parameters
AException
AErrorMessage
Returns

Implemented in Ict.Common.DB.TMySQL, and Ict.Common.DB.TPostgreSQL.

◆ NewAdapter()

DbDataAdapter Ict.Common.DB.IDataBaseRDBMS.NewAdapter ( )

Creates a DbDataAdapter object.

Returns
Instantiated object (derived from DbDataAdapter) - its actual Type depends on the RDBMS that we are connected to at runtime!

Implemented in Ict.Common.DB.TMySQL, and Ict.Common.DB.TPostgreSQL.

◆ NewCommand()

DbCommand Ict.Common.DB.IDataBaseRDBMS.NewCommand ( ref string  ACommandText,
DbConnection  AConnection,
DbParameter[]  AParametersArray,
TDBTransaction  ATransaction 
)

Creates a DbCommand object. This formats the sql query for the database, and transforms the parameters.

Parameters
ACommandText
AConnection
AParametersArray
ATransaction
Returns
Instantiated object (derived from DbCommand) - its actual Type depends on the RDBMS that we are connected to at runtime!

Implemented in Ict.Common.DB.TMySQL, and Ict.Common.DB.TPostgreSQL.

◆ RestartSequence()

void Ict.Common.DB.IDataBaseRDBMS.RestartSequence ( String  ASequenceName,
TDBTransaction  ATransaction,
TDataBase  ADatabase,
Int64  ARestartValue 
)

restart a sequence with the given value

Implemented in Ict.Common.DB.TMySQL, and Ict.Common.DB.TPostgreSQL.


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