Do I need to install SQLite so that SQLiteJDBC wor

2020-07-06 07:59发布

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!

1条回答
\"骚年 ilove
2楼-- · 2020-07-06 08:11

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.

查看更多
登录 后发表回答