title: What is the correct JDBC URL to connect to a RAC database
body: <p>We are connecting to Oracle from our code with a simple (custom) JDBC connector class. This class reads the connection properties from a resource file and tries to make a connection to Oracle (thin connection).</p>
  
  <p>However, recently the database have moved to a RAC and now the application is unable to connect to the DB. </p>
  
  <p>Here is the TNSPING output:</p>
  
  <pre><code>Used LDAP adapter to resolve the alias
  Attempting to contact (DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=OFF)(FAILOVER=ON)
  (ADDRESS=(PROTOCOL=TCP)(HOST=tst-db1.myco.com)(PORT=1604))
  (ADDRESS=(PROTOCOL=TCP)(HOST=tst-db2.myco.com)(PORT=1604)))(CONNECT_DATA=    
  SERVICE_NAME=mydb1.myco.com)(SERVER=DEDICATED)))
  OK (80 msec)
  </code></pre>
  
  <p>What would be the correct URL to specify in this case?</p>