Pure java sqlite library?

后端 未结 3 1243
生来不讨喜
生来不讨喜 2021-02-20 18:04

I saw Java and SQLite, but what ones are made in pure java and are platform independent? Also which would be the best to start with? I have never used sqlite but I assume it is

3条回答
  •  春和景丽
    2021-02-20 18:50

    SQLite is getting quite a lot of hype in other language domains, however with Java you have something else available:

    • HyperSQL (more commonly known as HSQLDB) is pure Java RDBMS which is specialized around running it as part of your application meaning that you can embed it to your software and it just works.
    • H2 is a complete rewrite of HypersonicSQL (common ancestor for H2 and HyperSQL) and is also fully Java. One nice feature of this one is RDBMS emulation which allows it to function with SQL written specifically for, say, Oracle RDBMS.
    • There's also the almost mandatory Apache Commons variation too, Apache Derby. As with the other two, Derby is also embeddable and has a small JAR file size footprint.

    As for tools, well, that varies a lot. Most of the Hypersonic family products for example are mainly meant for unit testing which means that you can unit test your DB Schemas and actual queries quite easily with (almost) plain Java code.

提交回复
热议问题