Files
jdescopingtool/OLD/DataModel/Process/JDE.cs
T
Joseph Doherty 26ff8d9b4f Initial commit: JDE Scoping Tool migration project
Set up repository with legacy .NET Framework 4.8 source (OLD/),
new .NET 10 Blazor solution (NEW/), OpenSpec specifications,
documentation, and project configuration.
2026-01-02 07:43:29 -05:00

52 lines
1.5 KiB
C#
Executable File

using System;
using NLog;
using Oracle.ManagedDataAccess.Client;
namespace DataModel.Process
{
/// <summary>
/// JDE interface
/// </summary>
public partial class JDE
{
/// <summary>
/// Query repository name
/// </summary>
private const string RepositoryName = "JDE";
/// <summary>
/// Query repository instance
/// </summary>
private static readonly QueryRepository queries = new QueryRepository(RepositoryName, Config.JDEQueryRepo);
/// <summary>
/// Shared logger instance
/// </summary>
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
/// <summary>
/// Gets an open connection to the JDE DB
/// </summary>
/// <returns>Opened connection to the JDE DB</returns>
public static OracleConnection GetConnection()
{
OracleConnection connection;
try
{
//Create the connection to the database and open it
connection = new OracleConnection(Config.JDECS);
connection.Open();
}
catch (Exception error)
{
//Log error and forward
logger.Error("GetConnection: failed to open connection to JDE: {0}.", error.Message);
throw new Exception("JDE: failed to open connection to JDE database.", error);
}
return connection;
}
}
}