@@ -0,0 +1,1175 @@
+package com.github.aureliano.edocs.app.cmd;%0A%0Aimport java.sql.SQLException;%0Aimport java.util.logging.Level;%0Aimport java.util.logging.Logger;%0A%0Aimport com.github.aureliano.edocs.app.EdocsApp;%0Aimport com.github.aureliano.edocs.common.exception.EDocsException;%0Aimport com.github.aureliano.edocs.common.persistence.IPersistenceManager;%0Aimport com.github.aureliano.edocs.common.persistence.PersistenceService;%0A%0Apublic class DisconnectCommand implements ICommand %7B%0A%0A%09private static final Logger logger = Logger.getLogger(DisconnectCommand.class.getName());%0A%09%0A%09@Override%0A%09public void execute() %7B%0A%09%09if (!this.canExecute()) %7B%0A%09%09%09return;%0A%09%09%7D%0A%09%09%0A%09%09IPersistenceManager pm = PersistenceService.instance().getPersistenceManager();%0A%09%09try %7B%0A%09%09%09pm.getConnection().close();%0A%09%09%09logger.info(%22Database connection has just been closed.%22);%0A%09%09%7D catch (SQLException ex) %7B%0A%09%09%09logger.log(Level.SEVERE, ex.getMessage(), ex);%0A%09%09%09throw new EDocsException(ex);%0A%09%09%7D%0A%09%09EdocsApp.instance().getFrame().setDatabaseGuiEnabled(false);%0A%09%7D%0A%0A%09@Override%0A%09public boolean canExecute() %7B%0A%09%09IPersistenceManager pm = PersistenceService.instance().getPersistenceManager();%0A%09%09return ((pm != null) && (pm.isConneceted()));%0A%09%7D%0A%7D

Create disconnect command.