在Mac上将数据库与Java一起使用 [英] Using databases with Java on Mac

查看:131
本文介绍了在Mac上将数据库与Java一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要创建一个连接到本地数据库文件的简单Java应用程序,并将在Mac上运行.

I need to create a simple Java application that connects to a local database file, and will run on a mac.

我认为JDBC是一个不错的选择,但是我应该使用哪种文件格式/驱动程序? .MDB文件是否可能?

I've figured that JDBC is a good option, but what file format/drivers should I use? Is .MDB files a possibility?

感谢您的帮助!

推荐答案

对于小型数据库,我建议使用用Java编写的数据库.数据库的下面或全部 < 2mb.将其保留在java中意味着可以轻松地将其转移到Windows/Linux.

For a small DB I would suggest using a DB written in Java. The DB's below or all < 2mb. Keeping it in java means it is easy to transfer to Windows / Linux if need be.

可能的数据库包括:

H2 -H2具有混合模式,首次打开数据库时是op 优点:

H2 - H2 has a mixed mode where the first time the DB is opened it is op Advantages:

  • 混合模式
  • 只有几个文件
  • 具有内置的SQL

HSQLDB -版本HSQLDB 1.80是这三个中的最小罐(很大幅度) 2. *罐子的大小类似于H2 优点:

HSQLDB - Version HSQLDB 1.80 is the smallest jar of the three (by a big margin) The 2.* jars are similar in size to H2 Advantages:

  • 体积小(版本1.80)
  • 只有几个文件

Apache Derby

这三者均提供服务器和嵌入式模式,H2也具有混合模式.这三个都是开源的.

All three offer Server and Embedded mode, H2 has mixed mode as well. All three are open source.

这篇关于在Mac上将数据库与Java一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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