DocumentType locationType = DocumentType.createDocumentType("Location", jugLocation);
locationType.setReference("venue", ElementType.TYPE_BACK_REFERENCE, "WorldJUGs", "NONE");
connection.saveDocumentType(locationType);
//4.Create the db object handle
DocumentMap dbDocHandle = connection.getDocumentMap("WorldJUGs");
//5. Store the data in the database
for(int j=0; j<documentCount; j++){
Document ljug = worldJugs.get(j);
dbDocHandle.store(Integer.toString(j), ljug);
}
//6. Close the connection
connection.close();
}