SQLite最适合用于嵌入式数据库吗? [英] Is SQLite the most appropriate thing to use for an embedded database?

查看:122
本文介绍了SQLite最适合用于嵌入式数据库吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要构建一个我将在Linux服务器上安装的Java应用程序。

I need to build a Java application that I will install on a Linux server.

当人们安装时,他们只需安装此应用程序,启动它,仅此而已。但是我们有一些数据要保存。

When people will install they just would need to install this application, launch it, and nothing more. But we have some data to save.


  • 我对MySQL说不,因为它需要服务器。

  • 我对XML说不,因为会有很多数据需要保存和操作。

所以我在看SQLite,这是我认为最好的。确实(如果我错了就停止我),SQLite不需要任何服务器? (只需安装最终的应用程序,SQLite在我的应用程序中工作正常吗?)

So I'm looking at SQLite which is the best I think. Indeed (stop me if i'm wrong), SQLite doesn't need any server? (just install the final application and SQLite works fine in my application?)

然后我检查了 http://www.sqlite.org/cvstrac/wiki?p=SqliteWrappers ,我真的有点困惑。

Then I checked at http://www.sqlite.org/cvstrac/wiki?p=SqliteWrappers and I'm really a little bit confused.


  • 包装器和驱动程序有什么区别?

  • 另外我看到存在纯Java实现:SQLJet是或多或少优化的?

  • 最后你会在我的情况下使用什么?

推荐答案

另一个需要考虑的数据库是 H2 。它是一个完全用Java编写的嵌入式数据库引擎,因此您可以获得Sqlite 所具有的完整unicode(16位)字符支持。其他嵌入式数据库是 HSQLDB Derby

Another database to consider is H2. It is an embedded database engine completely written in Java so you have the benefit of full unicode (16 bit) character support that Sqlite does not have. Other embedded databases are HSQLDB and Derby.


sqlite不需要服务器上的任何要求吗?

sqlite doesnt need any requirement on the server ?

正确。它不是。 H2也没有。

Correct. It does not. Neither does H2.


只需安装最终的应用程序,sqlite在我的应用程序中运行正常吗?

just install the final application and sqlite works fine in my application ?

正确。只要在WAR中包含Sqlite或H2(或将其解压缩到jar中),它就可以正常工作。

Correct. As long as you include Sqlite or H2 in your WAR (or unpack it into your jar), it will work fine.


什么是包装器和驱动器之间的区别?

What is the difference between a Wrapper and a Driver ?

取决于使用情况。我认为Sqlite正在谈论这样一个事实:当你为Sqlite使用JDBC驱动程序时,它实际上是驱动程序内部的中的Sqlite C代码的包装。通常,JDBC驱动程序与远程数据库通信。 Xerial驱动程序实际上是在一个小虚拟机中模拟Sqlite C代码 - 奇怪但它看起来效果很好。

Depends on the usage. I think Sqlite is talking about the fact that when you use the JDBC driver for Sqlite, it is actually a wrapping of the Sqlite C code inside of the driver. Typically the JDBC driver talks to a remote database. The Xerial driver actually is simulating the Sqlite C code in a little VM -- strange but it seems to work well.

H2实际上就是驱动程序做数据库操作,只是它是用Java编写的,所以你不需要C包装器。

H2 also is that way with the "driver" actually doing the database operations just that it was written in Java so you don't need the C wrapper.


另外我看到存在纯Java实现:SQLJet或多或少优化了?

Plus I see there exists a "pure java implementation" : SQLJet is it more or less optimized?

这是我第一次听说过Sqljet所以我是不确定。 Xerial Sqlite驱动程序是我使用的,它的性能似乎很好。

This is the first I've heard of Sqljet so I'm not sure. The Xerial Sqlite driver is what I've used and it's performance seems to be good.


最后你会在我的情况下使用什么?

Finally what would you use in my situation?

我自己使用H2来获取原生Java功能。

I'd use H2 myself for the native Java features.

这篇关于SQLite最适合用于嵌入式数据库吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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