OpenPetra
Free Administration Software for Non-Profits
|
every database system that works for OpenPetra has to implement these functions More...
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... | |
every database system that works for OpenPetra has to implement these functions
bool Ict.Common.DB.IDataBaseRDBMS.AdjustIsolationLevel | ( | ref IsolationLevel | AIsolationLevel | ) |
some databases have some problems with certain Isolation levels
AIsolationLevel |
Implemented in Ict.Common.DB.TMySQL, and Ict.Common.DB.TPostgreSQL.
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.
DbParameter[] Ict.Common.DB.IDataBaseRDBMS.ConvertOdbcParameters | ( | DbParameter[] | AParameterArray, |
ref string | ASqlStatement | ||
) |
convert the ODBC
AParameterArray | |
ASqlStatement |
Implemented in Ict.Common.DB.TMySQL, and Ict.Common.DB.TPostgreSQL.
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.
TheAdapter | |
AFillDataSet | |
AStartRecord | |
AMaxRecords | |
ADataTableName |
Implemented in Ict.Common.DB.TMySQL, and Ict.Common.DB.TPostgreSQL.
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.
TheAdapter | |
AFillDataTable | |
AStartRecord | |
AMaxRecords |
Implemented in Ict.Common.DB.TMySQL, and Ict.Common.DB.TPostgreSQL.
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!
ASqlQuery | SQL query |
Implemented in Ict.Common.DB.TMySQL, and Ict.Common.DB.TPostgreSQL.
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.
AServer | |
APort | |
ADatabaseName | |
AUsername | |
APassword | |
AConnectionString | |
AStateChangeEventHandler |
Implemented in Ict.Common.DB.TMySQL, and Ict.Common.DB.TPostgreSQL.
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.
ASequenceName | Name of the Sequence. |
ATransaction | An instantiated Transaction in which the Query to the DB will be enlisted. |
ADatabase | the database object that can be used for querying |
Implemented in Ict.Common.DB.TMySQL, and Ict.Common.DB.TPostgreSQL.
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.
ASequenceName | Name of the Sequence. |
ATransaction | An instantiated Transaction in which the Query to the DB will be enlisted. |
ADatabase | the database object that can be used for querying |
Implemented in Ict.Common.DB.TMySQL, and Ict.Common.DB.TPostgreSQL.
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.
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
AException | |
AErrorMessage |
Implemented in Ict.Common.DB.TMySQL, and Ict.Common.DB.TPostgreSQL.
DbDataAdapter Ict.Common.DB.IDataBaseRDBMS.NewAdapter | ( | ) |
Creates a DbDataAdapter object.
Implemented in Ict.Common.DB.TMySQL, and Ict.Common.DB.TPostgreSQL.
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.
ACommandText | |
AConnection | |
AParametersArray | |
ATransaction |
Implemented in Ict.Common.DB.TMySQL, and Ict.Common.DB.TPostgreSQL.
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.