Click here to Skip to main content
15,507,406 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a Quartz for .Net service that retrievs data from an Oracle 12c database using
. 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 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 :

and my connection string is as below :
    <add name="FCUBS" connectionString="user id=MYUSERNAME;password=mypassword*;data source=" />   

and for context the accompanying query operation is :

public static double GetExchangeRate()
            var flex = new FrontOfficeTransaction();
            double rate = 0.00;
                using (OracleConnection connp = new OracleConnection(FCUBSConnection))
                    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)
            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 :

    <add name="FCUBS" connectionString="user id=MYUSERNAME;password=mypassword*;Server=" />   
Updated 17-Apr-21 21:42pm

1 solution

Often the connection details are defined in tnsnames.ora[^]. In such case you would use the name of the tnsnames.ora entry as your data source

You can also omit the tnsnames and define the full details in the connection string. Have a look at Oracle connection strings -[^]

In both cases you don't define a database separately since the connection target (host, port....) already is the database.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900