I hope someone can help me. I\'m working on a simple application which connects with an SQLite database. Following is my connection code:
try {
There is something more than just Class.forName.
In the case you did both things below: - Added the sqlite jar library to lib folder under your project, reference to it in the project build path. - Added Class.forName("org.sqlite.JDBC") statement. And the error message "No suit driver" still appear, its may caused by your database path. If you are using Windows: Instead of:
DriverManager.getConnection("D:\\db\\my-db.sqlite").
You should use:
DriverManager.getConnection("jdbc:sqlite:D:\\db\\my-db.sqlite").
The "jdbc:sqlite:" will do the trick.
If you are using Linux, just change the seperator character: DriverManager.getConnection("jdbc:sqlite:/your/somepath/my-db.sqlite").