Samples

Data Abstract for Java provides a number of samples that demonstrate many of the features available in the Data Abstract SDK with samples demonstrating using Data Abstract for Java from the command line, from Netbeans with a base Swing user interface, to using Data Abstract in an Android based mobile application. There is also a sample that uses the Oxygene language.

All of the samples can be found by following the "Samples" shortcut located in C:\Program Files\RemObjects Software\Data Abstract for Java; or in whichever directory you installed Data Abstract for Java into.

The following samples are designed to be run from the command prompt

  • SimpleDataOperations this is the most basic sample that covers establishing a connection to an instance of Relativity, retrieving a DataTable, modifying data in a DataRow, adding and deleting a DataRow and applying those changes back to the server.
  • Briefcase sample demonstrates how to use Briefcases(concept). The sample retrieves data from an instance of Relativity, storing that data in a FileBriefcase and then retrieving that data.
  • Commands sample demonstrates how to use remote Commands which are stored in a schema
  • DASQL sample demonstrates how to use DA SQL (concept) to execute safe SQL queries on the schema data.
  • DynamicSelect sample demonstrates using Dynamic Select (concept) to selectively retrieve table fields from the server.
  • DynamicWhere sample demonstrates using Dynamic Where (concept) to dynamically create a WHERE statement used to retrieve data.
  • Common this is not a sample, but two additional source files that the other samples make use of. The DataTableExtension class provides a method that takes a DataTable and turns it into a pretty string that can be output to the console or some other log. The StringExtensions class is used by the DataTableExtension class, it provides some methods to join an array of strings with a delimiter, pad a string from the right and repeat a sequence of characters.

This sample has a Desktop UI and is run from Netbeans:

  • Simple (Netbeans) is a Netbeans based sample that uses a Swing UI and demonstrates retrieving a DataTable and making modifications to it.

Finally the following samples demonstrate using Data Abstract from Android based applications: