Database Connector: is it possible to connect to an Oracle DB with Service Name, not SID

   My DBA's would prefer me to connect to our Oracle DB using the service name, not the SID.    Is this possible?

    Our DB is Oracle 11g release 2, and I am using the ojdbc.jar (loaded in preferences, and shows up under Dialog 2:1 - Database Connector,    Database Driver: as   oracle.jdbc.driver.OracleDriver

This works with the URL using the SID of one of our loads, but the DBA's would prefer to be able to load balance by having me use the Service name.  My current working Database URL is

jdbc:oracle:thin:@myHostName:1521:mySID

 

Replacing the SID with the service name gives:

WARN      Database Reader                    java.sql.SQLException: java.sql.SQLException: java.sql.SQLException: Listener refused the connection with the following error:

ORA-12505, TNS:listener does not currently know of SID given in connect descriptor

This link to Oracle might be helful to solve the problem.