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:
- 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
- They never clarify whether SQLiteJDBC is dependent on SQLite for the API calls to work
Any help here is greatly appreciated!
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.
来源:https://stackoverflow.com/questions/7051975/do-i-need-to-install-sqlite-so-that-sqlitejdbc-works