On Nov 28, 2:18 am, mdipierro <mdipie...@cs.depaul.edu> wrote:
> There are two issues
>
> the bug in the line
> dbpath = os.path.join(self._folder, uri[14:])
> instread of
> dbpath = os.path.join(self._folder, uri[9:])
>
> is cutting "sqlite://storage.sqlite" short into "ge.sqlite" instead of
> "storage.sqlite". This can be fixed by replacing 14 with 9.

OK, the fix is right. I have 'storage.sqlite' intead of 'ge.sqlite'
and the file is there. Maybe I missed that in my last post.

> Yet, the file "ge.sqlite" or "storage.sqlite" is not supposed to be
> there but created by the line:
>
> zxJDBC.connect(java.sql.DriverManager.getConnection('jdbc:sqlite:'+dbpath))
>
> you are getting an error at this line:
> SQLException: java.sql.SQLException: No suitable driver found for
> jdbc:sqlite:/media/pierreth-backup/work/web2py/applications/welcome/
> databases/ge.sqlite
>
> That  means that your sqlite driver is not in the java classpath.

But if I check at the Jython shell I have:

>>> import sys
>>> sys.path
['', '/opt/java/lib/sqlitejdbc-v056.jar', '/usr/local/share/java/
sqlite.jar', '/home/pierreth/opt/java/jython-2.5.1/Lib',
'__classpath__', '__pyclasspath__/', '/home/pierreth/opt/java/
jython-2.5.1/Lib/site-packages']
>>> import java.lang.System as System
>>> System.getProperty("java.library.path")
u'/usr/local/lib'

My jars are in the class path and my native library is at the right
place too.

I don't understand. But you are right when you say that the problem is
at the Java level. I made a script in Groovy to access the same file
and I have this error instead:

Unable to load sqlite_jni: java.lang.UnsatisfiedLinkError: no
sqlite_jni in java.library.path
Caught: java.sql.SQLException: java.lang.UnsatisfiedLinkError:
SQLite.Database.internal_init()V
        at temp.run(temp.groovy:5)

I have 'libsqlite_jni.so' in /usr/local/lib and the java.library.path
property points to this directory. I don't know... I will on the
sqlite mailing list.

Reply via email to