Listing 1

import com.intersys.objects.*;
// Required for Caché Object Connection

Database dbconnection = null;
try{
	// Define the database connection and provide a valid username and password
	dbconnection = CachéDatabase.getDatabase
	(jdbc:Caché://localhost:1972/EGROK,dbUserName,dbPassword);

String selectedID = "1"; // Employee record ID - Test Data
	// Open the selected object by referencing the Id of the object
	Id id = new Id(selectedID)
	// Open the selected object by referencing the Id of the object 
	Employee employee = (Employee)Employee._open(dbconnection,id);

	// Do some stuff with the object here...
	employee.getUserName();
	// Get the username - defined in the Employee Class
	employee.getLastName();
	// Get the LastName - defined in the base.Person Class!!
	employee.setName("Fred");
	// Set a property

	employee.getDepartment().getName() // Get the department name!!!

	employee.getManager().getName() // Get the Manager's name!!!

	employee.save(); // Save the changes

	// De-reference the object
	dbconnection.closeObject(employee.getOref());
	employee=null;

	// Close the database connection
	dbconnection.close();
	dbconnection=null;

} // end try block
catch (CachéException e){
	System.out.println("Exception:" + e.toString() + ".");
}// end catch
finally{
	try{
		if(dbconnection != null)
			dbconnection.close();
	}// end try
	catch (CachéException e){
	System.out.println("Exception:" + e.toString() + ".");
	}// end catch
}// end finally