Accessing the Versant C++ database using Java
public class stars extends Applet implements Runnable{
Capability cap = new NewSessionCapability();
Properties prop = new Properties();
prop.put("database", "starsdb1");
s = new SimpleSession(prop,cap);
lMessage = new Label("Initialising...");
lMessage.setText("Initialised");
AttrFloat xcentre = s.newAttrFloat("Star::xcentre");
AttrFloat ycentre = s.newAttrFloat("Star::ycentre");
AttrFloat sigma = s.newAttrFloat("Star::sigma");
AttrInt catalogue = s.newAttrInt("Star::catalogue");
ClassHandle star = s.locateClass("Star");
HandleEnumeration he = star.select();
Handle [] ha = he.asArray();
lMessage.setText("Total of "+ha.length+" stars");
for(int i=0;i<.length;i++) {
float xpos = ha[i].get(xcentre);
float ypos = ha[i].get(ycentre);
float sig = ha[i].get(sigma);