oracle 在android应用程序中连接oracle
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4991334/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Connecting the oracle in android application
提问by RAAAAM
I am doing multimedia application. my issue is i want to connect oracle database into my application through JDBC. whenever i tried to connect jdbc driver it shows
我在做多媒体应用。我的问题是我想通过 JDBC 将 oracle 数据库连接到我的应用程序中。每当我尝试连接 jdbc 驱动程序时,它都会显示
Dxwarning: Ignoring InnerClasses attribute for an anonymous inner class (oracle.jdbc.pool.OracleRuntimeLoadBalancingEventHandlerThread$1) that doesn't come with an associated EnclosingMethod attribute. This class was probably produced by a compiler that did not target the modern .class file format. The recommended solution is to recompile the class from source, using an up-to-date compiler and without specifying any "-target" type options. The consequence of ignoring this warning is that reflective operations on this class will incorrectly indicate that it is notan inner class.
Dxwarning:忽略不带有关联 EnclosureMethod 属性的匿名内部类 (oracle.jdbc.pool.OracleRuntimeLoadBalancingEventHandlerThread$1) 的 InnerClasses 属性。此类可能是由未针对现代 .class 文件格式的编译器生成的。推荐的解决方案是从源代码重新编译类,使用最新的编译器并且不指定任何“-target”类型选项。忽略这个警告的后果是对这个类的反射操作会错误地表明它不是一个内部类。
can anyone link the exact jar file for oracle JDBC for android application.
任何人都可以为 android 应用程序的 oracle JDBC 链接确切的 jar 文件。
采纳答案by Tanmay Mandal
You cannot import a JAR implementing java.* classes easily. And, JDBC would need to be ported to Android, since it probably relies upon classes in JavaSE that Android lacks. And, you would need to write your own JDBC driver for SQLite anyway, wrapping the API Android already supplies, since I suspect the existing JDBC driver uses JNI. And, when all of that is done, you will have an application that adds a lot of bloat, making it less likely people will download and retain your application.
您无法轻松导入实现 java.* 类的 JAR。而且,JDBC 需要移植到 Android,因为它可能依赖于 Android 缺少的 JavaSE 中的类。而且,无论如何您都需要为 SQLite 编写自己的 JDBC 驱动程序,包装 Android 已经提供的 API,因为我怀疑现有的 JDBC 驱动程序使用 JNI。而且,当所有这些都完成后,您的应用程序会增加很多膨胀,从而降低人们下载和保留您的应用程序的可能性。
回答by PDStat
I'm very interested in this. I was trying something similar yesterday with the mysql driver (ultimately it will be an oracle connection though), everything I've googled says it's either a very bad idea to use jdbc with android or simply not possible.
我对这个很感兴趣。我昨天正在尝试使用 mysql 驱动程序进行类似的操作(不过最终它将是一个 oracle 连接),我在 google 上搜索的所有内容都表明,将 jdbc 与 android 一起使用是一个非常糟糕的主意,或者根本不可能。
Yet you've managed to connect to an oracle database. I'd be interested to know performance etc.
然而,您已经设法连接到一个 oracle 数据库。我有兴趣了解性能等。