title: Oracle 12c database connection using thin driver throws IO error
body: <p>I'm following the JDBC Developer's Guide and trying to test the JDBC thin driver connection using a short java program.</p>
  
  <pre><code>import java.sql.*;
  import oracle.jdbc.*;
  import oracle.jdbc.pool.OracleDataSource;
  class JDBCVersion
  {
  public static void main (String args[]) throws SQLException
  {
          OracleDataSource ods = new OracleDataSource();
          ods.setURL("jdbc:oracle:thin:hr/hr@localhost:1522:orcl");
          Connection conn = ods.getConnection();
          // Create Oracle DatabaseMetaData object
          DatabaseMetaData meta = conn.getMetaData();
          // gets driver info:
          System.out.println("JDBC driver version is " + meta.getDriverVersion());
  }
  } //&lt;host&gt;:&lt;port&gt;:&lt;service&gt;
  </code></pre>
  
  <p>I've tried every possible <code>&lt;host&gt;:&lt;port&gt;:&lt;service&gt;</code> combination but still get a <code>java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection</code></p>
  
  <p>I've successfully tested the OCI driver using another program included in the tutorial....but can't get this one to work.  My application will be using the thin driver to connect to the database so my frustration level is....climbing.</p>
  
  <p>Any help is appreciated.</p>