Optional use of SID

My connection works when I use SERVICE_NAME instead of SID. We should allow this to be chosen in a config, could you please review this change and amend if not suitable.