public List<LibBranch> ListBranches() throws Exception {
   ConnectionUtil c = new ConnectionUtil();
   Connection conn = c.createConnection();
   try {
     LibBranchDAO lib = new LibBranchDAO(conn);
     List<LibBranch> branches = lib.readAll();
     conn.commit();
     return branches;
   } catch (Exception e) {
     e.printStackTrace();
     return null;
   } finally {
     conn.close();
   }
 }
  /** *************************************************************************************** */
  public LibBranch ListOneBranche(int branchId) throws Exception {

    ConnectionUtil c = new ConnectionUtil();
    Connection conn = c.createConnection();

    try {

      LibBranchDAO lib = new LibBranchDAO(conn);
      LibBranch branch = lib.readOne(branchId);
      return branch;

    } catch (Exception e) {
      // TODO: handle exception
      e.printStackTrace();
      return null;
    } finally {
      conn.close();
    }
  }
 /** *************************************************************************************** */
 public void DeleteLibBranch(LibBranch branch) throws Exception {
   ConnectionUtil c = new ConnectionUtil();
   Connection conn = c.createConnection();
   try {
     if (branch == null
         || branch.getLibraryBranchName() == null
         || branch.getLibraryBranchName().length() == 0
         || branch.getLibraryBranchName().length() > 45
         || branch.getLibraryBranchAddress() == null
         || branch.getLibraryBranchAddress().length() == 0
         || branch.getLibraryBranchAddress().length() > 45) {
       throw new Exception("The Book cannot be null");
     } else {
       LibBranchDAO lib = new LibBranchDAO(conn);
       lib.delete(branch);
       conn.commit();
     }
   } catch (Exception e) {
     e.printStackTrace();
     conn.rollback();
   } finally {
     conn.close();
   }
 }