Question

I guess I'm just not "getting it". If I don't have SQLite already installed on my computer, and I want to write a Java app that uses an embedded database, and I download/import the SQLiteJDBC JAR into my project, is that all I need? Or, do I need to first install SQLite before and create a database file for my SQLiteJDBC code to connect to and run queries from?

If that's the case, and its not sufficient to just download/import SQLiteJDBC, then doesn't that mean that I'll have to make sure SQLite is installed on every system that I want to run my Java app on? And doesn't that defeat the purpose of a portable/embedded database?

Basically, I'm getting hung up on the SQLiteJDBC tutorials because:

  1. They don't tell you how HelloWorld.sqlite gets created (does SQLiteJDBC create it for you, do you have to create it in SQLite first from the command prompt, etc.); and
  2. They never clarify whether SQLiteJDBC is dependent on SQLite for the API calls to work

Any help here is greatly appreciated!

Was it helpful?

Solution

You have to put the SQLLite JAR in the CLASSPATH of your app. There's no "install" beyond that.

Maybe this tutorial can help you.

Here's another that shows how to create a database and tables.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top