Client Database APIs

The generated package database class provides methods for managing the client database.

public static void createDatabase()
public static void deleteDatabase()
public static boolean databaseExists()

Typically, createDatabase does not need to be called since it is called internally when necessary. An application may use deleteDatabase when uninstalling the application.

Use the transaction API to group several transactions together for better performance.

public static com.sybase.persistence.LocalTransaction beginTransaction()
Customer customer = Customer.findByPrimaryKey(101);
   // Use one transaction to save and submit pending
   LocalTransaction tx = SUP101DB.beginTransaction();
   // modify customer information
   customer.save();
   customer.submitPending();
   tx.commit();