sqlite layer?

Forum is for miscellaneous user help requests.

sqlite layer?

Postby danutz » Mon Feb 09, 2015 10:02 am


I'm trying to create a new sqlite layer (Database type, Other). But I get a locked brown layer that seems to be read only. I can't create a root class in it. If I "generate random graph" to it, it throws a null pointer exception. What's wrong and what do I need to do?

Here's what I've done: I first edited wandora/bin/SetClasspath.sh to include the sqlite driver jar at the end (3.8.7 from bitbucket.org/xerial/sqlite-jdbc/downloads). This works because I was then able to use the SQL exctractor on an sqlite3 database.

Then, top menu Layer / New Layer, Type: Database, click "New" button. In new dialog, Type: other, Name: sqlite, driver: sqlite, connection string: /tmp/db.sq3, username: my system username (it won't allow me to leave it empty)

The sqlite layer is brown in the layers list. It cannot be unlocked. If I select it and make it the only visible layer, then try to create root class, I get a read only exception. If I "generate random graph" to it, it throws a null pointer exception

How is this supposed to work?
Posts: 3
Joined: Mon Feb 09, 2015 9:38 am

Re: sqlite layer?

Postby danutz » Mon Feb 09, 2015 12:49 pm

driver = org.sqlite.JDBC
Connection string = jdbc:sqlite:/tmp/wandora.sq3
User = <whatever>

Database must be initialized prior to using it
Posts: 3
Joined: Mon Feb 09, 2015 9:38 am

Re: sqlite layer?

Postby akivela » Mon Feb 09, 2015 6:28 pm

Hi Dan

I tried to set up a database layer for sqlite. Everything went smoothly after I figured out how to build the connection string. I use WIN7 environment.

First, I created a database with sqlite3.exe labeled as wandora and initialized database tables with (your) database creation clauses (https://github.com/danmbox/wandora/blob ... sqlite.sql).

I didn't add the sqlite-jdbc-3.8.7.jar to SetClasspath file. I just dropped the jar into the build/lib folder. SetClasspath already contains a setting to include all jars in lib (but not in subfolders). Do you use the source code package of Wandora? If yes, notice, Wandora scans jars in the build/lib, not in the lib.

Then I opened Wandora and created a database layer with

Driver: org.sqlite.JDBC
Connection string: jdbc:sqlite:C:\Users\akivela\Desktop\test\wandora
User: wandora

The layer creation was successful and I was able to generate a small random graph into the layer without exceptions.

I have Java version 1.7.0_15 installed.

I have a hunch that somehow you are not able to connect the database. Do you have a file named as wandora.sq3 in /tmp ? And has the application sufficient access rights?

If you can't get sqlite database working, please submit the exception Wandora throws and I'll examine it a little more detailed.

Kind Regards,
Aki / Wandora team
Site Admin
Posts: 260
Joined: Tue Sep 18, 2007 10:20 am
Location: Helsinki, Finland

Re: sqlite layer?

Postby danutz » Wed Feb 11, 2015 12:29 am


thanks, I replied to myself above, it works :)

I initially thought that "Connection string" should only include the path component, but in fact it must be the full string, including jdbc:
Posts: 3
Joined: Mon Feb 09, 2015 9:38 am

Return to How to... and problems

Who is online

Users browsing this forum: No registered users and 1 guest