Update (1st February 2013)
DO NOT READ THIS PAGE.
The only Java client library for Z39.50 that we would recommend is Index Data's YAZ4J, a set of Java classes that wrap the popular and powerful ZOOM-C functions. See also this tutorial.
All the rest of the content of this page, and those it links to, is retained for historical interest only. Most of the software it mentions is now abandonware. If you choose to read on, do so at your own peril.
The Java binding is maintained by Matthew Dovey <m.dovey@ceridwen.com>
You probably want the current version.
The Java binding is largely specified: it's complete enough that it's possible to build working implementations (I have done so), but it should not be considered stable. It is liable to change: in particular, towards being more idiomatic Java.
The following version of the interface specification are available:
To give a flavour of the Java binding, here is ZOOM's equivalent of the ``Hello World'' program: a tiny Z39.50 client that fetches and displays the MARC record for Farlow & Brett Surman's The Complete Dinosaur from the Library of Congress.
import uk.org.miketaylor.zoom.*; class Canonical { public static void main (String[] args) throws Exception { Connection conn = new Connection("z3950.loc.gov", 7090); conn.option("databaseName", "Voyager"); conn.option("preferredRecordSyntax", "USMARC"); Query q = new PrefixQuery("@attr 1=7 0253333490"); ResultSet rs = conn.search(q); System.out.println(rs.getRecord(0).render()); } }
NEW! We finally have a complete are released open-source implementation for Java: YAZ4J (indexdata.com/yaz4j) is a JNI wrapper for ZOOM-C, originally written by Talis and packaged, released and maintained by Index Data.
At least three other streams of work begun on Java bindings, though none had reached a releasable level of maturity the last time I looked:
On another tack, they will be supporting external Z39.50 interfaces for their services, so even if they don't use it for internal messaging, they might still look at how ZOOM could help support external messaging via Z39.50.
Contact Ralph LeVan <levan@oclc.org> for details.
As I was writing the binding specification, I ran into a surprising number of issues which may be of interest to others. Some of them are no doubt just down to my lack of familiarity with Java; others seem to highlight real deficiencies in the language[1]. Here they are, for anyone who wants to understand more of the reasoning behind the decisions made in this binding.
Notes