Can SQLiteJDBC work without installing SQLite and can it initialize database tables?

I tried to find this on my own, but to no avail. I am writing a Java application that will use the embedded SQLite database through Zentu SQLiteJDBC.

I make the following assumptions and need confirmation on all of them, and where I am wrong, clarifications.

  • To run my Swing application correctly, I need SQLite installed on every machine where my application is located, and not just the file "myEmbeddedDatabase.db"
  • During installation / deployment, the shell script will work best, which will call sqlite and run the skeleton / init script, which creates the tables, etc. that my application will use through SQLiteJDBC; I guess this is because it doesn't look like SQLiteJDBC has the ability to read the * .sql file and run it (well, at least there is a lot of coding without me!)

Thanks to everyone who can help clarify these issues for me!

+4
source share
2 answers

1) No, all you need is a link to the java driver. This is the appeal of an embedded database system. Some functions that you usually find in a fully installed database system are missing (for example, network support), but in return you do not need to install anything on the client machine.

2) It is best to just create a database schema (table definitions, but not contents) at design time. Thus, you can simply deploy it as a resource with your application and copy it to a suitable folder the first time you launch the application. Alternatively, the java driver will allow you to create a database in code (and add tables to it). In any case, if you update the application, you will need to write a manual code that checks the database version and updates the schema, adding or removing columns / tables as necessary.

+4
source

For my Swing application to start correctly, I will need SQLite installed on each that my application is located, and not just the file "myEmbeddedDatabase.db"

No. You do not need to do this. SQLite is written for this. This is not a complete database system that needs to be installed (e.g. MySQL). After you have linked the jdbc driver to your application, you can use the entire executable program of compiled java.

0
source

All Articles