Exit Routine

The final routine that is called when exiting the YMLD system is the exitYMLD() method, which closes the application.

public void exitYMLD() throws Exception {
  try {
    conn.close();
  }
  catch (Exception se) {
  }
  System.exit(0);
}

The database connection is closed before we exit the system. This ensures that any statements are properly terminated, especially if a transaction was started and no COMMIT statement was issued. Developers should make sure that all of their SQL statements are autocommitted, or that transactions, once complete, are committed explicitly.

Get Apache Derby—Off to the Races: Includes Details of IBM® Cloudscape™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.