I have a Quartz for .Net service that retrievs data from an Oracle 12c database using
System.Data.OracleClient
. I am able to connect and get values when attempting this from a Console application but once i migrate the code and bundle it into a Quartz scheduler service i get the error
Connection parameter not supported: 'DATABASE'
when the job runs.
I have implemented the service on several Quartz.net jobs that connect to Sql Server without such issues. It appears this problem is particular to connection strings for the Oracle provider.
My Quartz service implementation is taken from the example here :
https://medium.com/better-programming/asp-net-core-windows-service-task-scheduler-daily-weekly-monthly-700a569d502a
and my connection string is as below :
<pre><connectionStrings>
<add name="FCUBS" connectionString="user id=MYUSERNAME;password=mypassword*;data source=10.167.67.667:6767/COMPANYLIVE" />
</connectionStrings>
and for context the accompanying query operation is :
public static double GetExchangeRate()
{
var flex = new FrontOfficeTransaction();
double rate = 0.00;
try
{
using (OracleConnection connp = new OracleConnection(FCUBSConnection))
{
connp.Open();
OracleCommand cmd1 = new OracleCommand("select * from fgpreprod.xxxx_rates where ccy4 in ('USD','GBP') AND ccy2 in ('USD','GBP') and branch_code='089' and RATE_TYPE='MIDRATE'", connp);
OracleDataReader dr1 = cmd1.ExecuteReader();
while (dr1.Read())
{
flex.ExchangeRate = Convert.ToDouble(dr1["MID_RATE"]);
rate = flex.ExchangeRate;
}
}
}
catch (Exception ex)
{
ExceptionLogging.SendErrorToText(ex);
}
return rate;
}
What I have tried:
I have tried using
Server instead of
data source as per suggestions from some sources but im still getting the error :
<pre><connectionStrings>
<add name="FCUBS" connectionString="user id=MYUSERNAME;password=mypassword*;Server=10.167.67.667:6767/COMPANYLIVE" />
</connectionStrings>