While I'm having some trouble installing and setting up derby, I do have partial success:
root@dur:~/apache-james-3.0-beta4/var/store/derby#
root@dur:~/apache-james-3.0-beta4/var/store/derby# ll
total 36
drwxr-xr-x 5 root root 4096 Aug 23 16:46 ./
drwxr-xr-x 5 501 staff 4096 Aug 23 02:07 ../
-rw-r--r-- 1 root root 4 Aug 23 02:07 dbex.lck
-rw-r--r-- 1 root root 38 Aug 23 02:07 db.lck
-rw-r--r-- 1 root root 187 Aug 23 16:46 derby.log
drwxr-xr-x 2 root root 4096 Aug 23 02:07 log/
drwxr-xr-x 2 root root 4096 Aug 23 02:07 seg0/
-rw-r--r-- 1 root root 868 Aug 23 02:07 service.properties
drwxr-xr-x 2 root root 4096 Aug 23 02:07 tmp/
root@dur:~/apache-james-3.0-beta4/var/store/derby#
root@dur:~/apache-james-3.0-beta4/var/store/derby# java org.apache.derby.tools.ij
ij version 10.9
ij> quit;
root@dur:~/apache-james-3.0-beta4/var/store/derby#
How do I now query this particular database?
A full example, using Derby and Squirrel, presuming you have a Derby database already installed on the system:
$HOME/bin/squirrel
$HOME/bin/db-derby
cd $HOME/bin/squirrel ; ./squirrel-sql.sh
)$DERBY_HOME/lib/derby.jar
.seg0
).At this point the Apache Derby Embedded icon should no longer have a red X.
Then:
seg0
.The database is now connected and you should see the schemas.
Then:
SELECT * FROM SYS.SYSTABLES
You can now execute SQL statements against the Derby database.
Note: This does not technically answer the question, as this answer does not explain how to use the interactive command-line interface (ij
). The answer proposes a viable alternative to querying the database using Squirrel's graphical interface.