You can use Squirrel SQL to open derby database and examine their contents. This is sometimes handy for debugging purposes.

Warning Squirrel SQL is a developer tool, you need to be familiar with SQL syntax to use it.

Step 1: Download and install Squirrel SQL:  http://squirrel-sql.sourceforge.net/ . The standard edition should suffice.

Step 2: Register the embedded derby database driver (derby.jar).

  • First download derby.jar e.g. from the pathvisio repository  http://svn.bigcat.unimaas.nl/pathvisio/trunk/lib/derby.jar . Note the directory where it is saved.
  • In Squirrel SQL, click the "Drivers" tab on the left side. Double-click on apache derby embedded. The "Change Driver" dialog should pop up.
  • In the Extra Class Path tab, add the derby.jar you just added.
  • Click OK. The dialog should close, and you should see the line "Driver class org.apache.derby.jdbc.EmbeddedDriver? sucessfully registered for driver definition: Apache Derby Embedded" in the panel at the bottom of the main window.

Step 3: Create an alias for the derby database you want to open

  • Hit the Aliases tab on the left side of the main window. The "Add alias" dialog should pop up.
  • Pick any name
  • For Driver, choose "Apache Derby Embedded"
  • The URL should look like "jdbc:derby:jar:(<filename of pgdb>)database, where you replace <filename of pgdb> with the pgdb file you want to open. The parentheses should be there. For example jdbc:derby:jar:(/home/martijn/PathVisio-Data/gene databases/Hs_Derby_20080102.pgdb)database
  • Leave user and password empty
  • You can test the settings with the "Test" button, or just save with "OK".

Now you can examine the database. You can run SQL queries against the database under the SQL tab. Just enter the query and click the run icon in the toolbar. For example:

Examine tables

select * from info;
select * from datanode;
select * from link;
select * from attribute;

A list of system codes plus number of identifiers per system code

select code, count (*) from datanode group by code

Look for an id pattern, are there any id's that start with NM_ ???

select * from datanode where id like 'NM_%'

Which attributes are in use, and how often are they used?

select attrname, count(*) from attribute group by attrname

Attachments