title: Unable to connect to Oracle DB in Java
body: <p><strong>Problem:</strong></p>
  
  <p>If I use:</p>
  
  <pre><code>ods = new OracleDataSource();
  ods.setURL("jdbc:oracle:thin:@//localhost:5521/oracledb");
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>java.sql.SQLRecoverableException: IO Error: The Network Adapter could
  not establish the connection
  </code></pre>
  
  <p>If I use:</p>
  
  <pre><code>ods = new OracleDataSource();
  ods.setURL("jdbc:oracle:oci:localhost:5521:oracledb");
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>Caused by: java.lang.UnsatisfiedLinkError: oracle.jdbc.driver.T2CConnection.t2cLogoff(J)I
      at oracle.jdbc.driver.T2CConnection.t2cLogoff(Native Method)
      at oracle.jdbc.driver.T2CConnection.logoff(T2CConnection.java:664)
      at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:697)
      at oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:54)
      at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:566)
      at oracle.jdbc.pool.OracleDataSource.getPhysicalConnection(OracleDataSource.java:317)
      at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:241)
      at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:184)
      ... 67 more
  </code></pre>
  
  <p>I'm using Oracle SQL 12c. I can use 'SQL developer' just fine with no issues. Where is the documentation that lists excactly what my connection setup will look like in java so I don't have to keep quessing at it? I've read tons of documentation that goes on and on about every little thing <em>except</em> how to know for sure that you will be using the right connection setup in Java.</p>