If you like a cli tool, http://henplus.sourceforge.net/ is ok and easy to modify if you feel inclined.
It's written in Jython and used jdbc.
There is a version with line-editing around using jline.