Package org.mapache.business

Examples of org.mapache.business.MapacheException


            }
            _loadCategoriesForTopicStmt.close();
        } catch (SQLException e) {
            categories = null;
            cats =null;
            throw new MapacheException("Error occurred when loading categories for topic from database", e);
        } catch (DAOException e) {
             categories = null;
             cats=null;
             throw new MapacheException("Error occurred when loading categories for topic from database", e);
        } finally {
            MySQLDAOFactory.freeConnection(_oConn);
        }
        return cats;
    }
View Full Code Here


            ResultSet resultSet = _loadAllCategoriesStmt.executeQuery();
            loadResultsInList(categories,resultSet);
            _loadAllCategoriesStmt.close();
        } catch (SQLException e) {
            categories = null;
            throw new MapacheException("Error occurred when loading categories from database", e);
        } catch (DAOException e) {
             categories = null;
             throw new MapacheException("Error occurred when loading categories from database", e);
        } finally {
            MySQLDAOFactory.freeConnection(_oConn);
        }
        return categories;
    }
View Full Code Here

            c = fetchRecordInCategoryObject(resultSet);
            _loadCategoryByCategoryIdStmt.close();
        } catch (SQLException e) {
            c= null;
            throw new MapacheException("Error occurred when loading categories from database", e);
        } catch (DAOException e) {
             c= null;
             throw new MapacheException("Error occurred when loading categories from database", e);
        } finally {
            MySQLDAOFactory.freeConnection(_oConn);
        }
        return c;
    }
View Full Code Here

            }
            _oConn.commit();
            _oConn.setAutoCommit(true);
            _saveCategoryForTopicStmt.close();
        } catch (SQLException e) {
            throw new MapacheException("Error occurred when saving categories of topic", e);
        } catch (DAOException e) {
             throw new MapacheException("Error occurred when saving categories of topic", e);
        } finally {
            MySQLDAOFactory.freeConnection(_oConn);
        }
    }
View Full Code Here

            _saveCategoryStmt.setString(1, category.getName());
            _saveCategoryStmt.setInt(2, category.getCategoryID());
            _saveCategoryStmt.execute();
            _saveCategoryStmt.close();
        } catch (SQLException e) {
            throw new MapacheException("Error occurred when saving category", e);
        } catch (DAOException e) {
             throw new MapacheException("Error occurred when saving category", e);
        } finally {
            MySQLDAOFactory.freeConnection(_oConn);
        }

    }
View Full Code Here

                    _oConn.prepareStatement("DELETE FROM Category WHERE CategoryID = ?");
            _deleteCategoryStmt.setInt(1, category.getCategoryID());
            _deleteCategoryStmt.execute();
            _deleteCategoryStmt.close();
        } catch (SQLException e) {
            throw new MapacheException("Error occurred when deleting category", e);
        } catch (DAOException e) {
             throw new MapacheException("Error occurred when deleting category", e);
        } finally {
            MySQLDAOFactory.freeConnection(_oConn);
        }
    }
View Full Code Here

                    _oConn.prepareStatement("INSERT INTO Category(Name) VALUES(?)");
            _createCategoryStmt.setString(1, newCategory.getName());
            _createCategoryStmt.execute();
            _createCategoryStmt.close();
        } catch (SQLException e) {
            throw new MapacheException("Error occurred when creating category", e);
        } catch (DAOException e) {
             throw new MapacheException("Error occurred when creating category", e);
        } finally {
            MySQLDAOFactory.freeConnection(_oConn);
        }
    }
View Full Code Here

            ResultSet resultSet = _loadAllCategoriesStmt.executeQuery();
            loadResultsInList(categories,resultSet);
            _loadAllCategoriesStmt.close();
        } catch (SQLException e) {
            categories = null;
            throw new MapacheException("Error occurred when loading categories from database", e);
        } catch (DAOException e) {
             categories = null;
             throw new MapacheException("Error occurred when loading categories from database", e);
        } finally {
            MySQLDAOFactory.freeConnection(_oConn);
        }
        return categories;
    }
View Full Code Here

            ResultSet resultSet = _loadAllCategoriesStmt.executeQuery();
            loadResultsInList(categories,resultSet);
            _loadAllCategoriesStmt.close();
        } catch (SQLException e) {
            categories = null;
            throw new MapacheException("Error occurred when loading categories from database", e);
        } catch (DAOException e) {
             categories = null;
             throw new MapacheException("Error occurred when loading categories from database", e);
        } finally {
            MySQLDAOFactory.freeConnection(_oConn);
        }
        return categories;
    }
View Full Code Here

            c = fetchRecordInCategoryObject(resultSet);
            _loadCategoryByCategoryIdStmt.close();
        } catch (SQLException e) {
            c= null;
            throw new MapacheException("Error occurred when loading categories from database", e);
        } catch (DAOException e) {
             c= null;
             throw new MapacheException("Error occurred when loading categories from database", e);
        } finally {
            MySQLDAOFactory.freeConnection(_oConn);
        }
        return c;
    }
View Full Code Here

TOP

Related Classes of org.mapache.business.MapacheException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.