title: How to connect to Oracle DB via "bequeath" OCI in Java?
body: <p>I tried the following url string variations:</p>
  
  <pre><code>String url = "jdbc:oracle:oci:"+msDbUser+"/"+msPassword+"/@";
  
  String url = "jdbc:oracle:oci:@//&lt;TNS entry&gt;";
  
  String url = "jdbc:oracle:oci:@//&lt;hostname&gt;:&lt;port&gt;:&lt;SID&gt;";
  </code></pre>
  
  <p>Then I connect using:</p>
  
  <pre><code>conn = DriverManager.getConnection(url);
  </code></pre>
  
  <p>But all of them result to a vague SQL Exception "java.sql.SQLException: ??" as shown below.  I tried googling this error but I cannot find any information on it.</p>
  
  <pre><code>java.sql.SQLException: ??
      at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
      at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)
      at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:650)
      at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:338)
      at oracle.jdbc.driver.PhysicalConnection.&lt;init&gt;(PhysicalConnection.java:508)
      at oracle.jdbc.driver.T2CConnection.&lt;init&gt;(T2CConnection.java:133)
      at oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:53)
      at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:510)
      at java.sql.DriverManager.getConnection(Unknown Source)
      at java.sql.DriverManager.getConnection(Unknown Source)
      at com.pca.test.TestConn.main(TestConn.java:75)
  </code></pre>
  
  <p>Note that via regular THIN driver it's connecting fine, so I'm sure my DB is okay.  However, my requirement at work is to use a "bequeath" connection and OCI.</p>
  
  <pre><code>jdbc:oracle:thin:@&lt;HOSTNAME&gt;:&lt;PORT&gt;:&lt;SID&gt;
  </code></pre>