4

I'm trying to add an embedded database to my application, but I have no clue where to begin. So far I've found that I should download the sqlite-jdbc driver and add the .jar to my project. From there I'm kind of lost, are there any good tutorials to get me started or some helpful tips?

Also, I'm using Eclipse for my IDE, so if there's anything within there that will simplify the process, feel free to add that as well!

Aaron
  • 896
  • 3
  • 11
  • 22
  • 1
    Instead of dealing with all the nasty dependency resolving by bare keyboard, I recommend using Maven... That makes things a lot easier. And also, doing research, for example entering Java sqlite embedded tutorial into a proper search engine yields results [like this one](http://stackoverflow.com/questions/41233/java-and-sqlite) – ppeterka Jul 31 '13 at 20:27
  • Yes, I'm smart enough to have searched this multiple times and ways. But how does that show whether that's embedded or not? It could be a standalone install of SQLite right? Or maybe I'm just misunderstanding how SQLite works. – Aaron Jul 31 '13 at 20:45
  • People usually go for something like Apache Derby when they want an embedded db in a Java application. – OrangeDog Jul 31 '13 at 20:57
  • And there's no such thing as a standalone install of SQLite AFAIK. – OrangeDog Jul 31 '13 at 20:58
  • You may find a pure Java DB (i.e. H2, HSQLDB, Apache Derby see http://stackoverflow.com/questions/17897551/using-databases-with-java-on-mac/17903715#17903715) a better fit than SQLite. – Bruce Martin Jul 31 '13 at 23:04

1 Answers1

3

You want dependency management here? Read up on Maven (very easy), write a Maven pom.xml file and load it into Eclipse that way. Eclipse and NetBeans understand Maven very well now. No need to learn an Eclipse-specific way to do this since Maven will work as well in NetBeans as Eclipse and is simple to run on the command line too.

Based on what search.maven.org says, your dependency in Maven would be this added to a standard pom file to get the latest:

<dependency>
    <groupId>org.xerial</groupId>
    <artifactId>sqlite-jdbc</artifactId>
    <version>3.7.15-M1</version>
</dependency>
Mike Thomsen
  • 36,828
  • 10
  • 60
  • 83