如何使用我的Andr​​oid应用连接HSQL(基于文件)? [英] How to connect HSQL (file based) with my android app?

查看:168
本文介绍了如何使用我的Andr​​oid应用连接HSQL(基于文件)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我有我的Andr​​oid应用程序连接到HSQLDB一个问题。

Hello I have a problem connecting my android app to HSQLDB.

第一个问题:

是否有HSQLDB特定的Andr​​oid罐子,我应该使用或我可以用任何HSQL罐子?

Is there a specific android jar for HSQLDB that i should use or could I use any HSQL jar?

第二个问题:

如果我可以使用所提供的罐子。我怎样才能连接到工作,我应该在的Class.forName(),因为我用的时候是越来越一个ClassNotFoundException错误的地方:
的Class.forName(org.hsqldb.jdbc.JDBCDriver)或调用Class.forName(org.hsqldb.jdbc.JDBCDriver)。的newInstance()?

If I can use the provided jar. How can I get the connection to work and what should I place in the Class.forName("") as I was getting a ClassNotFoundException error when using: Class.forName("org.hsqldb.jdbc.JDBCDriver") or Class.forName("org.hsqldb.jdbc.JDBCDriver").newInstance() ?

感谢您。

推荐答案

我已经能够建立一个HSQLDB的连接中的Andr​​oid 4.1。

I have been able to establish a connection to an HSqlDB in Android 4.1.

任何人谁在寻找这样做在Eclipse中,确保你在你的库中的hsqldb.jar中,并确保它的出口。所有这一切都是在Eclipse项目> Java构建路径。

Anyone who's looking to do this in Eclipse, make sure you have the hsqldb.jar in your libraries and make sure it's exported. All of this is in the Project > Java Build Path in Eclipse.

我能够建立连接,并创造了一套新的数据库文件。我使用的是基于文件的数据库。特别是我建立一个LibGDX游戏欧雅,但它应该为所有Android项目。运行HSQL的code是从Android项目一个完全不同的项目,所以我需要它作为两个库,并把它从Android项目中导出。

I'm able to make a connection and it has created a new set of database files. I'm using a file based db. Specifically I'm building a LibGDX game for Ouya, but it should work for any android project. The code that runs Hsql is in a completely different project from the Android project, so I needed to have it as a library for both, and to have it exported from the Android project.

这篇关于如何使用我的Andr​​oid应用连接HSQL(基于文件)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆