missing JDBC driver oracle 10g android 4.x

后端 未结 1 1801
遇见更好的自我
遇见更好的自我 2021-01-21 04:39

I\'ve got a few problems with my running projet but this one is the worst :

    String url=\"jdbc:oracle:login/pwd@host:1521:etudom\";
    Connection co = null;
         


        
相关标签:
1条回答
  • 2021-01-21 05:10

    Newer Oracle drivers (at least ojdbc6.jar, maybe earlier ones as well) do not work on Android. They require several classes from the Java Standard Edition (Java SE) that are not available on the stripped down Android platform.

    Update:

    The error message is pretty clear:

    Could not find class 'javax.management.MBeanServer'
    

    This is a Java SE class that's missing on Android. It might want to have a look at the question Android Oracle Database JDBC6. This user was able to use ojdbc14.jar on Android.

    Possibly he/she used the Oracle client differently, e.g. Class.forName("oracle.jdbc.OracleDriver"); instead of Class.forName("oracle.jdbc.driver.OracleDriver");. Or he/she used a different connection string that internally uses different classes. Or it's an older driver even though is called ojdbc14.jar as well.

    Anyhow there's no guarantee that it will ever work. Oracle Java client is build for Java SE and not for the Android Java, which only contains those classes that are normally used on a mobile device.

    0 讨论(0)
提交回复
热议问题