Package ke.go.moh.oec.reception.controller.exceptions

Examples of ke.go.moh.oec.reception.controller.exceptions.PersistenceManagerException


        if (instance == null) {
            try {
                instance = new PersistenceManager();
            } catch (Exception ex) {
                Logger.getLogger(PersistenceManager.class.getName()).log(Level.SEVERE, null, ex);
                throw new PersistenceManagerException();
            }
        }
        return instance;
    }
View Full Code Here


                user.setAdmin(resultSet.getBoolean("admin"));
                authentic = true;
            }
        } catch (SQLException ex) {
            Logger.getLogger(PersistenceManager.class.getName()).log(Level.SEVERE, null, ex);
            throw new PersistenceManagerException();
        } finally {
            this.close(statement);
            this.close(resultSet);
        }
        log("User '" + user.getUsername() + "' attempted to log into reception with password '******' [success = '" + authentic + "'].");
View Full Code Here

        } catch (SQLException ex) {
            if (ex.getErrorCode() == 30000) {
                throw new ExistingUserException();
            } else {
                Logger.getLogger(PersistenceManager.class.getName()).log(Level.SEVERE, null, ex);
                throw new PersistenceManagerException();
            }
        } finally {
            this.close(statement);
        }
    }
View Full Code Here

            statement.executeUpdate("UPDATE " + userTable + " SET password = '" + new String(user.getPassword())
                    + "', admin = " + (user.isAdmin() ? 1 : 0) + " WHERE username = '" + user.getUsername() + "'");
            log("User '" + user.getUsername() + "' modified with password = '******' and admin = '" + user.isAdmin()+ "'");
        } catch (SQLException ex) {
            Logger.getLogger(PersistenceManager.class.getName()).log(Level.SEVERE, null, ex);
            throw new PersistenceManagerException();
        } finally {
            this.close(statement);
        }
    }
View Full Code Here

            statement = this.getStatement();
            statement.executeUpdate("DELETE FROM " + userTable + " WHERE username = '" + user.getUsername() + "'");
           log("User '" + user.getUsername() + "' deleted with password = '******' and admin = '" + user.isAdmin()+ "'");
        } catch (SQLException ex) {
            Logger.getLogger(PersistenceManager.class.getName()).log(Level.SEVERE, null, ex);
            throw new PersistenceManagerException();
        } finally {
            this.close(statement);
        }
    }
View Full Code Here

            statement.executeUpdate("INSERT INTO " + departmentTable + "(name, code) VALUES ('"
                    + department.getName() + "', '" + department.getCode() + "')");
            log("Department '" + department.getName() + "' created with code = '" + department.getCode()+ "'");
        } catch (SQLException ex) {
            Logger.getLogger(PersistenceManager.class.getName()).log(Level.SEVERE, null, ex);
            throw new PersistenceManagerException();
        } finally {
            this.close(statement);
        }
    }
View Full Code Here

            statement.executeUpdate("UPDATE " + departmentTable + " SET code = '"
                    + department.getCode() + "' WHERE name = '" + department.getName() + "'");
            log("Department '" + department.getName() + "' modified with code = '" + department.getCode()+ "'");
        } catch (SQLException ex) {
            Logger.getLogger(PersistenceManager.class.getName()).log(Level.SEVERE, null, ex);
            throw new PersistenceManagerException();
        } finally {
            this.close(statement);
        }
    }
View Full Code Here

            statement = this.getStatement();
            statement.executeUpdate("DELETE FROM " + departmentTable + " WHERE name = '" + department.getName() + "'");
            log("Department '" + department.getName() + "' deleted with code = '" + department.getCode()+ "'");
        } catch (SQLException ex) {
            Logger.getLogger(PersistenceManager.class.getName()).log(Level.SEVERE, null, ex);
            throw new PersistenceManagerException();
        } finally {
            this.close(statement);
        }
    }
View Full Code Here

            if (resultSet.next()) {
                exist = false;
            }
        } catch (SQLException ex) {
            Logger.getLogger(PersistenceManager.class.getName()).log(Level.SEVERE, null, ex);
            throw new PersistenceManagerException(ex.getMessage());
        }
        return exist;
    }
View Full Code Here

TOP

Related Classes of ke.go.moh.oec.reception.controller.exceptions.PersistenceManagerException

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.