windream
This commit is contained in:
@@ -85,35 +85,35 @@ Public Class Firebird
|
||||
''' <param name="Password"></param>
|
||||
''' <exception cref="Exceptions.DatabaseException"></exception>
|
||||
Public Sub New(LogConfig As LogConfig, Datasource As String, Database As String, User As String, Password As String)
|
||||
Try
|
||||
_MyLogger = LogConfig
|
||||
_Logger = _MyLogger.GetLogger()
|
||||
Dim oConnectionString = GetConnectionString(Datasource, Database, User, Password)
|
||||
|
||||
_MyLogger = LogConfig
|
||||
_Logger = _MyLogger.GetLogger()
|
||||
_connectionServer = Datasource
|
||||
_connectionDatabase = Database
|
||||
_connectionUsername = User
|
||||
_connectionPassword = Password
|
||||
_connectionString = oConnectionString
|
||||
|
||||
_Logger.Debug("Connecting to database..")
|
||||
|
||||
' Test the connection
|
||||
Dim oConnection = GetConnection()
|
||||
' If initial connection was successfully, close it
|
||||
oConnection.Close()
|
||||
|
||||
If oConnection Is Nothing Then
|
||||
Throw New Exceptions.DatabaseException()
|
||||
Else
|
||||
_DBInitialized = True
|
||||
End If
|
||||
|
||||
Dim oConnectionString = GetConnectionString(Datasource, Database, User, Password)
|
||||
_Logger.Debug("Connection sucessfully established!")
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
End Try
|
||||
|
||||
_connectionServer = Datasource
|
||||
_connectionDatabase = Database
|
||||
_connectionUsername = User
|
||||
_connectionPassword = Password
|
||||
_connectionString = oConnectionString
|
||||
|
||||
_logger.Debug("Connecting to database..")
|
||||
|
||||
' Test the connection
|
||||
Dim oConnection = GetConnection()
|
||||
' If initial connection was successfully, close it
|
||||
oConnection?.Close()
|
||||
|
||||
If oConnection Is Nothing Then
|
||||
Throw New Exceptions.DatabaseException()
|
||||
Else
|
||||
_DBInitialized = True
|
||||
End If
|
||||
|
||||
_logger.Debug("Connection sucessfully established!")
|
||||
End Sub
|
||||
|
||||
Public Function GetConnection() As FbConnection
|
||||
|
||||
Reference in New Issue
Block a user