title: Loading Oracle JDBC Driver Class in Android
body: <p>I am trying to connect to Oracle database remotely
  I add the jar file as suggested in this link <a href="https://stackoverflow.com/questions/1334802/how-can-i-use-external-jars-in-an-android-project">How can I use external JARs in an Android project?</a> (most voted answer)
  The code as follows</p>
  
  <pre><code>public class MainActivity extends Activity {
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      try{
          Class.forName("oracle.jdbc.driver.OracleDriver");
          Connection connection = null;
          ......
  </code></pre>
  
  <p>when I debug, I found that it always throws exception at the <code>Class.forName</code> line</p>
  
  <pre><code>java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
  </code></pre>
  
  <p>The jar file is from <a href="http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-112010-090769.html" rel="nofollow noreferrer">http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-112010-090769.html</a>  (ojdbc6.jar)</p>
  
  <p>I looked for hours about it, any suggestions how to fix it.</p>
  
  <p>Note: I tried the same code in normal java program - added the same jar file -in main method and it worked</p>