Package org.mapache.business

Examples of org.mapache.business.MapacheException


    public void saveBlog(Blog _blog) throws MapacheException {
        blogDataAccess.saveBlog(_blog);
    }
    public void deleteBlog(Blog blog) throws MapacheException {
        if(blog.getTopicCount()>0){
            throw new MapacheException("Blog contains topics, can't delete blog",null);
        }
        else{
            blogDataAccess.deleteBlog(blog);
        }
    }
View Full Code Here


                return true;
            else
                return false;
           
        } catch (SQLException e) {
            throw new MapacheException("Unable to authenticate user",e);
        } catch (DAOException e) {
            throw new MapacheException("Unable to authenticate user",e);
        } finally{
            MySQLDAOFactory.freeConnection(_oConn);
        }
       
    }
View Full Code Here

            config.setDatabaseUser(xpath.evaluate("/config/database/user",document));
            config.setDatabasePass(xpath.evaluate("/config/database/pass",document));
            config.setEmail(xpath.evaluate("/config/blog/administrator-email",document));
            config.setSmtp(xpath.evaluate("/config/blog/administrator-smtp",document));
        } catch (SAXException e) {
            throw new MapacheException("Unable to read configuration file",e);
        } catch (IOException e) {
            throw new MapacheException("Unable to read configuration file",e);
        } catch (XPathExpressionException e) {
            throw new MapacheException("Unable to read configuration file",e);
        } catch (ParserConfigurationException e) {
            throw new MapacheException("Unable to read configuration file",e);
        }
        return config;
    }
View Full Code Here

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

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

            else
                _createReplyStmt.setString(5, reply.getUserHomePage());
            _createReplyStmt.execute();
            _createReplyStmt.close();
        } catch (SQLException e) {
            throw new MapacheException("Error occurred when creating reply", e);
        } catch (DAOException e) {
             throw new MapacheException("Error occurred when creating reply", e);
        } finally{
            MySQLDAOFactory.freeConnection(_oConn);
        }
    }  
View Full Code Here

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

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

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

            _saveTopicStmt.setString(4,MySQLDataUtils.convertCalendarToSQLDateString(topic.getPublishDate()));
            _saveTopicStmt.setInt(5, topic.getTopicID());
            _saveTopicStmt.execute();
            _saveTopicStmt.close();
        } catch (SQLException e){
            throw new MapacheException("Error occurred when saving a topic", e);
        } catch (DAOException e) {
             throw new MapacheException("Error occurred when saving a topic", e);
        } finally{
            MySQLDAOFactory.freeConnection(_oConn);
        }
    }
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.