Hopefully, this should be an easy one for the Oracle bods.
So, further to my previous Question, I now need to be able to process a connection string in C# and decide whether to perform an LDAP lookup on the 'Data Source' value (if it is a service name), or just take it as it is (a connect descriptor). What is the best and most definitive way of doing this? I don't want to be doing wishy-washy things like checking if the first character is an open parenthesis. I'm looking for a specific pattern/signature to identify if a 'Data Source' is a service name or connect descriptor.
For example (as obtained here), with a service name, it might be this:
Data Source=TORCL;User Id=myUsername;Password=myPassword;
With a connect descriptor, it might be this:
Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=MyOracleSID)));User Id=myUsername; Password=myPassword;
Thanks.
In the absence of an answer, I devised my own solution which isn't complicated and I've assumed that a connect descriptor will always contain "DESCRIPTION". If this assumption is correct, the solution is correct. If not, then please feel free to suggest your own...