This discussion is archived
2 Replies Latest reply: Nov 1, 2012 5:16 PM by 907069 RSS

Connect oracle from android application

907069 Newbie
Currently Being Moderated
Is it possible to connect directly to Oracle database from Android application, without using any web service or Oracle Mobile Server.

If so which jdbc driver should I use? I've tried ojdbc14.jar which I could connect Oracle from Eclipse traditionally, but it did not work with while I am trying to develop an android application with Eclipse.

Oracle 11.2

Android 4.1.2 (API 16)
  • 1. Re: Connect oracle from android application
    rp0428 Guru
    Currently Being Moderated
    If you use your favorite seach engine and search for 'android oracle jdbc' you will get plenty of links to investigate including these:
    http://docs.oracle.com/cd/E17076_02/html/installation/build_android_jdbc.html
    http://nobytes.blogspot.com/2012/01/tricky-issue-of-oracle-jdbc-and-android.html
    http://ibabo.tistory.com/126
    http://stackoverflow.com/questions/5727857/connecting-to-an-oracledb-via-an-android-app
  • 2. Re: Connect oracle from android application
    907069 Newbie
    Currently Being Moderated
    I've tried those links previous days. Not successful.

    My development platform is Windows, Eclipse Indigo with ADT 20, Android 4.1.2. , JRE6 below is my connection code


              oracle.jdbc.OracleDriver oradriver = new oracle.jdbc.OracleDriver();
              try {
                   DriverManager.registerDriver(oradriver);
              System.out.println("Connecting database...");     
                   Connection conn = DriverManager.getConnection(
                             "jdbc:oracle:thin:@10.10.x.xx:1521:SID", "user", "passwd");
                   System.out.println("Connected database...");     
                   
              } catch (SQLException e) {
                   e.printStackTrace();
              }


    I use AVD emulator. Database in local network. Access to internet is via proxy.


    When I run above code in Eclipse , LogCat displays the following error
    E/dalvikvm(1964): Could not find class 'oracle.security.pki.OracleWallet', referenced from method oracle.jdbc.driver.OracleDriver.getSecretStoreCredentials

    continues execution

    I/System.out(1964): Connecting database...

    and gives below warning

    W/dalvikvm(1964): Link of class 'Loracle/jdbc/xa/OracleXAResource;' failed


    I could not figure out what is wrong

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points