简体   繁体   English

从Android连接到MS Access数据库时出错

[英]Error while Connecting to MS Access Database From Android

I'm trying to retrieve data's from MS Access Database on my desktop. 我正在尝试从台式机上的MS Access数据库检索数据。 I didn't add any external jar file to retrieve data actually i don't know whether i have to export any external jar file for accomplishing this. 我没有添加任何外部jar文件来检索数据,实际上我不知道是否需要导出任何外部jar文件来完成此操作。 Here is the code which i'm using to connect to Ms Access Database on my PC. 这是我用来连接到PC上的Ms Access数据库的代码。

String driver = "sun.jdbc.odbc.JdbcOdbcDriver";
            Class.forName(driver).newInstance();
            String path="D:/MS ACCESS DATABASE/mydatabase.mdb";
            conn = DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Access Driver  (*.mdb)};DBQ="+path+";","","root" );
            Log.w("Connection", "open");
            Statement stmt = conn.createStatement();
            ResultSet reset = stmt.executeQuery("select * from tblEmp");

while executing this i'm getting following error on my log-cat 执行此操作时,我在日志猫上收到以下错误

10-25 11:31:40.545: W/Error connection(422): sun.jdbc.odbc.JdbcOdbcDriver

Please Help me to Solve this issue?? 请帮我解决这个问题?

You can not connect from Android to MS Access using Sun's JDBC-ODBC Bridge. 您无法使用Sun的JDBC-ODBC Bridge从Android连接到MS Access。 The JDBC-ODBC Bridge from sun will only connect to a local server not a remote one. sun的JDBC-ODBC桥将仅连接到本地服务器,而不连接到远程服务器。 There is a commercial option from Easysoft in there JDBC-ODBC Bridge . EasysoftJDBC-ODBC Bridge中有一个商业选项。 This can connect from a Java application / applet to a remove server and then on to an MS Access ODBC data source. 这可以从Java应用程序/小程序连接到删除服务器,然后再连接到MS Access ODBC数据源。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM