TobyInkster.co.uk

14/06/2007: HenPlus

For a while, I’ve been using a great little Java-based GUI SQL client called dbVisualizer. It’s a nifty little database management tool that — here’s the good part — supports virtually every database backend under the sun. I use it to manage PostgreSQL and MySQL databases at home and PostgreSQL and Microsoft SQL Server at work, and I can flit between them, using a consistent interface for them all. It’s great.

However, being a GUI app, it’s a bit slow for when I just want to make one or two small queries, so I went looking for a speedy command-line equivalent today and found HenPlus. Like dbVis, HenPlus is based on Java and JDBC, so it’s able to work with a staggering array of backends. It’s command-line based, so it should work double-fast, even over a SSH connection.

The one problem I had installing it was with libreadline-java, which is a bridge between Java and GNU readline. (GNU readline is a library that allows tab-completion and command history — it seriously speeds up command-line work.) I installed the Mandriva Cooker RPM package but it seemed to be missing a couple of files.

My solution was to download and install the source RPM and then:

cd /usr/src/RPM/
rpm -ba SPECS/libreadline-java.spec
[This may give you an error, but leaves behind important files!]
cd BUILD/libreadline-java-0.8.1/
make T_LIBS=JavaReadline
cp libJavaReadline.so /usr/lib/
ln -s /usr/lib/libJavaReadline.so /usr/lib/libJavaReadline.so.0.8.1

also I needed to apply the following patch to /usr/bin/henplus:

--- /usr/bin/henplus.orig   2007-06-14 16:57:51.000000000 +0100
+++ /usr/bin/henplus    2007-06-14 17:36:19.000000000 +0100
@@ -13,6 +13,8 @@
     JAVA=$JAVA_HOME/bin/java
 fi
 
+JAVA=/usr/java/jre1.5.0_07/bin/java
+
 ##------------------
 THISDIR=`dirname $0`
 HENPLUSDIR=$THISDIR/../share/henplus
@@ -26,7 +28,7 @@
 # Modify this, if you installation stores this at a different
 # position.
 LD_LIBRARY_PATH=$THISDIR/../lib:/usr/lib/jni:$LD_LIBRARY_PATH
-CLASSPATH=$CLASSPATH:$THISDIR/../share/java/libreadline-java.jar
+CLASSPATH=$CLASSPATH:$THISDIR/../share/java/libreadline-java.jar:/usr/lib/java/libreadline-java.jar
 
 # you may just throw your own jar files in this dir.
 # (like additional JDBC-drivers, that are not in default

It’s working great now

Comments

Comment 001

Hi, Toby,
It turns out that henplus is installable under Ubuntu right through the Synaptic package manager, or with “apt get install henplus”, whcih is just as easy. I’ll give it a try.

…cheers mbstevens

Author: Anonymous Coward [4.230.132.116]
Date: Friday, 15th June 2007, 1:48pm (BST)

Comments are moderated and may take one or two days to show up on the site. You can bypass comment moderation by signing up as a registered user.

Google Search

Article Details

Author:Toby Inkster
Licence:All rights reserved
Created:Thu, 14 Jun 2007
Status:Standard
Permalink:Permalink

June 2007

M T W T F S S
28 29 30 31 1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 1

Blogroll

Here are some other sites. Some might be good; some might be rubbish. You decide.