Does the Oracle JDBC data source support a clustered database using a service name instead of an SID

pankaj_puniani
ServiceNow Employee
ServiceNow Employee

I'm trying to set up a JDBC data source to an Oracle database. The DB admins tell me not to use an SID because the databases are clustered and if one server goes down, I will lose connectivity even though another instance may be available on another server.

Does the Oracle JDBC data source support a clustered database using an alias/service name instead of an SID?

1 ACCEPTED SOLUTION

natalliar
ServiceNow Employee
ServiceNow Employee

To configure the JDBC data source to use service name you should modify the connection URL. The default Data Source form does not show the Connection URL field. The Connection URL field will allow you to enter the connection string with the correct format for using Service Name.

To use a service name, the syntax is
jdbc:oracle:thin@//host:port/servicename




To add the Connection URL field:


  • right click on the header and select Configure -> Form Layout
  • select Connection URL from Available and move to Selected, Save

View solution in original post

3 REPLIES 3

natalliar
ServiceNow Employee
ServiceNow Employee

To configure the JDBC data source to use service name you should modify the connection URL. The default Data Source form does not show the Connection URL field. The Connection URL field will allow you to enter the connection string with the correct format for using Service Name.

To use a service name, the syntax is
jdbc:oracle:thin@//host:port/servicename




To add the Connection URL field:


  • right click on the header and select Configure -> Form Layout
  • select Connection URL from Available and move to Selected, Save

Thanks for the tip! It worked for me, but I had to add a : before the @ . So the Connection URL should be:



jdbc:oracle:thin:@//host:port/servicename



Maybe you want to edit your post?



Also, for me it worked with and without the // . In other words, the following also worked:



jdbc:oracle:thin:@host:port/servicename


adriantan08
Giga Expert

Note that there's a Business Rule called "Build Connection URL" that would revert any changes you attempted to try to use SERVICE_NAME and switch it back to SID connection string format.