import com.gemstone.gbj.*;

public class Test {

  public void doit( ) {
    GbjParameters p = new GbjParameters();
    p.serverName = "STONE_NAME_HERE";
    p.userName = "DataCurator";
    p.password = "swordfish";
    GbjSession s = new GbjSession(p);
    System.out.println("Logging in GBJ session...");
    s.connect();
    s.beginTransaction();
    System.out.println("Writing X..");
    s.execute("UserGlobals at: #X put: 'This is a test'");
    s.commit();
    System.out.println("Reading X..");
    GbjObject x = s.objectNamed("X");
    System.out.println("GBJ  X = " + x);
    System.out.println("Java X = " + x.stringValue());
    System.out.println("Closing GBJ session...");
    s.close();
    System.out.println("Exiting...");
  }

  public static void main(String[] args) {
    new Test().doit();
  }

}
