SQLException: no SQLite library found

Hi everybody! I'm using netbeans to create an erp application with a sqlite database, but i have a problem.

When i compile my program from netbeans it's all right, but when i build a jar, at the first call to the database i get this SQLException:no SQLite library found.

I've inserted the sqlitejdbc inside my application to avoid the change of classpath by user.

How can I do? Please someone help me!!

thanks, bye!

[457 byte] By [MLI-Boccaa] at [2007-11-27 3:50:29]
# 1
Is the sqlitejdbc driver added to the classpath of the jar file? Check the manifest file.
BalusCa at 2007-7-12 8:54:24 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2
Thaks for your fast reply! I've added in the manifest.mf this commands:Main-Class: application.MainScreenClass-Path: ./sqlitejdbc.jarThe jar compile correctly but the response is the same. What's wrong?
MLI-Boccaa at 2007-7-12 8:54:24 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 3
I am not sure if "./" works, I have never tried it, but if you have put it in the root of the package, then just "sqlitejdbc.jar" should work. So remove the "./" from it.
BalusCa at 2007-7-12 8:54:24 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 4

Also without ./ the program throw the exception in object.

My apps is composed by principal package called application, a package called org.sqlite (extracted from the sqlitejdbc.jar) for comunication with database and I put the sqlitejdbc.jar into root folder (default package).

Another idea?

MLI-Boccaa at 2007-7-12 8:54:24 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 5
Are you executing this program by calling "java -jar something.jar"? The manifest will not be used if you do not do that.
DrClapa at 2007-7-12 8:54:24 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 6
Yes! I generate jar file from netbeans and then I execute the program with "java -jar something.jar". How can use Manifest?
MLI-Boccaa at 2007-7-12 8:54:24 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 7
create the manifest file (manifest.mf) like the following:Main-Class: application.MainScreenClass-Path: sqlitejdbc.jarAppend two empty lines to the manifest file.Put the sqlitejdbc.jar in the same directory as the feberated jar file.Hope That Helps
java_2006a at 2007-7-12 8:54:24 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 8
It doesn't work in this way! I've modified the manifest.mf as you said and i've put the sqlitejdbc.jar in the same directory of MyApps.jar (build from netbeans).The excepition remains the same: no SQLite library found.Do you have any other ideas?
MLI-Boccaa at 2007-7-12 8:54:24 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 9
post the manifest.mf content plz
java_2006a at 2007-7-12 8:54:24 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 10
This is my Manifest.mf:Main-Class: application.MainScreenClass-Path: sqlitejdbc.jar There are two empty lines as you suggest.
MLI-Boccaa at 2007-7-12 8:54:24 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 11
list the libraries (.jar file) used in your project (under NetBeans) plz?
java_2006a at 2007-7-12 8:54:24 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 12
Here the solution: http://www.zentus.com/sqlitejdbc/usage.htmlHope That helps
java_2006a at 2007-7-12 8:54:24 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 13
Victory!! I've put the sqlitejdbc.jar and the sqlitejdbc.dll in the same directory of my jar and when I launch it with: java -cp sqlitejdbc.jar -jar myapps.jar the program work very well!Thanks a lot for your help!
MLI-Boccaa at 2007-7-12 8:54:24 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 14

hey Luca,

i had the same experience while trying to use SQLite for one of my java project...

actually the SQLite JDBC driver comes with a DLL file for windows, you need to put that DLL file in JAVA Library Path...

get that DLL file and simply put that in where java executable is i.e. %JAVA_HOME%\jre\bin

it should work...

else use this tutorial

http://www.pysquared.com/files/Java/JavaSQLiteExample/

i suggest you dont use the pure java driver or you may or may not get Out of Memory error...

i_virusa at 2007-7-12 8:54:24 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...