Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do I need to install SQLite so that SQLiteJDBC works?

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!

like image 503
Massie Avatar asked Aug 13 '11 17:08

Massie


People also ask

Do I need to download SQLite?

SQLite does not need to be "installed" before it is used. There is no "setup" procedure. There is no server process that needs to be started, stopped, or configured. There is no need for an administrator to create a new database instance or assign access permissions to users.

Is SQLite already installed on Windows?

Depending on your OS environment, SQLite server may already come bundled with your Operating System. For example, Mac OS X comes pre-isntalled with SQLite and can be executed using the sqlite3 command. However, you may need to install SQLite in some cases and on other OSes.


1 Answers

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.

like image 68
duffymo Avatar answered Oct 21 '22 13:10

duffymo