Database: Fix connection string error

This commit is contained in:
Jonathan Jenne
2022-09-28 14:09:37 +02:00
parent 1632e86c1e
commit 711d0edd04
5 changed files with 41 additions and 58 deletions

View File

@@ -6,7 +6,7 @@ Public Class Oracle
Implements IDatabase
Public Property DBInitialized As Boolean = False Implements IDatabase.DBInitialized
Public Property ConnectionString As String = "" Implements IDatabase.ConnectionString
Public Property CurrentConnectionString As String = "" Implements IDatabase.CurrentConnectionString
Private ReadOnly _Timeout As Integer
Private ReadOnly _Logger As Logger
@@ -23,8 +23,8 @@ Public Class Oracle
_Timeout = Timeout
_Logger = LogConfig.GetLogger()
ConnectionString = GetConnectionString(Server, Database, UserId, Password)
DBInitialized = TestCanConnect(ConnectionString)
CurrentConnectionString = GetConnectionString(Server, Database, UserId, Password)
DBInitialized = TestCanConnect(CurrentConnectionString)
End Sub
Private Function TestCanConnect(ConnectionString As String) As Boolean
@@ -85,7 +85,7 @@ Public Class Oracle
Try
Dim oSQLconnect As New OracleConnection
Dim oSQLCOmmand As OracleCommand
oSQLconnect.ConnectionString = ConnectionString
oSQLconnect.ConnectionString = CurrentConnectionString
oSQLconnect.Open()
oSQLCOmmand = oSQLconnect.CreateCommand()
oSQLCOmmand.CommandText = executeStatement
@@ -111,7 +111,7 @@ Public Class Oracle
Try
Dim oSQLconnect As New OracleConnection
Dim oSQLCOmmand As OracleCommand
oSQLconnect.ConnectionString = ConnectionString
oSQLconnect.ConnectionString = CurrentConnectionString
oSQLconnect.Open()
oSQLCOmmand = oSQLconnect.CreateCommand()
oSQLCOmmand.CommandText = executeStatement
@@ -129,7 +129,7 @@ Public Class Oracle
Public Function GetDatatable(pSQLCommand As String, pTimeout As Integer) As DataTable Implements IDatabase.GetDatatable
Try
Using oConnection = GetConnection(ConnectionString)
Using oConnection = GetConnection(CurrentConnectionString)
Dim oSQLCommand As OracleCommand
oSQLCommand = oConnection.CreateCommand()
oSQLCommand.CommandText = pSQLCommand
@@ -157,7 +157,7 @@ Public Class Oracle
Public Function ExecuteNonQuery(pSQLCommand As String, pTimeout As Integer) As Boolean Implements IDatabase.ExecuteNonQuery
Try
Using oConnection = GetConnection(ConnectionString)
Using oConnection = GetConnection(CurrentConnectionString)
Dim oSQLCOmmand As OracleCommand
oSQLCOmmand = oConnection.CreateCommand()
oSQLCOmmand.CommandText = pSQLCommand
@@ -183,7 +183,7 @@ Public Class Oracle
Public Function GetScalarValue(pSQLCommand As String, pTimeout As Integer) As Object Implements IDatabase.GetScalarValue
Dim result
Try
Using oConnection = GetConnection(ConnectionString)
Using oConnection = GetConnection(CurrentConnectionString)
Dim oSQLCOmmand As OracleCommand
oSQLCOmmand = oConnection.CreateCommand()
oSQLCOmmand.CommandText = pSQLCommand