jj: oh my god /o\

This commit is contained in:
Jonathan Jenne
2018-12-14 16:18:12 +01:00
parent ee11d3cdc0
commit e30bc21cf2
22 changed files with 626 additions and 108 deletions

View File

@@ -94,6 +94,8 @@ Public Class Firebird
_connectionPassword = Password
_connectionString = oConnectionString
_logger.Debug("Connecting to database..")
' Test the connection
Dim oConnection = GetConnection()
' If initial connection was successfully, close it
@@ -102,6 +104,8 @@ Public Class Firebird
If oConnection Is Nothing Then
Throw New Exceptions.DatabaseException()
End If
_logger.Debug("Connection sucessfully established!")
End Sub
Public Function GetConnection() As FbConnection
@@ -165,6 +169,8 @@ Public Class Firebird
''' <param name="Connection">The Firebird connection to use</param>
''' <returns>True, if command was executed sucessfully. Otherwise false.</returns>
Public Function ExecuteNonQueryWithConnection(SqlCommand As String, Connection As FbConnection) As Boolean
_logger.Debug("Executing Non-Query: {0}", SqlCommand)
If Connection Is Nothing Then
Return Nothing
End If
@@ -208,6 +214,8 @@ Public Class Firebird
''' <param name="Connection">The Firebird connection to use</param>
''' <returns>The scalar value if the command was executed successfully. Nothing otherwise.</returns>
Public Function GetScalarValueWithConnection(SqlQuery As String, Connection As FbConnection) As Object
_logger.Debug("Fetching Scalar-Value: {0}", SqlQuery)
If Connection Is Nothing Then
Return Nothing
End If
@@ -252,6 +260,8 @@ Public Class Firebird
''' <param name="Connection">The Firebird connection to use</param>
''' <returns>A datatable containing the results if the command was executed successfully. Nothing otherwise.</returns>
Public Function GetDatatableWithConnection(SqlQuery As String, Connection As FbConnection, Optional TransactionMode As TransactionMode = TransactionMode.NoTransaction) As DataTable
_logger.Debug("Fetching Datatable: {0}", SqlQuery)
If Connection Is Nothing Then
Return Nothing
End If