Examples of DAOExcepcion


Examples of upc.iluminados.excepcion.DAOExcepcion

    UsuarioDAO usuarioDAO = new UsuarioDAO();

    public void insertar(Usuario vo) throws DAOExcepcion {

        if (StringUtils.isEmpty(vo.getCorreo())) {
            throw new DAOExcepcion("Correo Requerido");
        }
        if (StringUtils.isEmpty(vo.getDni())) {
            throw new DAOExcepcion("Dni Requerido");
        }

        if (StringUtils.isEmpty(vo.getClave())) {
            throw new DAOExcepcion("Clave Requerida");
        }

        if (StringUtils.isEmpty(vo.getNombre())) {
            throw new DAOExcepcion("Nombres Requeridos");
        }
        if (StringUtils.isEmpty(vo.getApellidoPaterno())) {
            throw new DAOExcepcion("Apellido Paterno Requerido");
        }
        if (StringUtils.isEmpty(vo.getApellidoMaterno())) {
            throw new DAOExcepcion("Apellido Materno Requerido");
        }
       
        Usuario usuario = usuarioDAO.obtenerCorreo(vo.getCorreo());
        if (usuario != null) {
            throw new DAOExcepcion("El correo ya existe");
        }
        if (usuarioDAO.obtenerdni(vo.getDni()) != null) {
            throw new DAOExcepcion("El DNI ya existe");
        }

        usuarioDAO.insertar(vo);
    }
View Full Code Here

Examples of upc.iluminados.excepcion.DAOExcepcion

            if (i != 1) {
                throw new SQLException("No se pudo insertar");
            }
        } catch (SQLException e) {
            System.err.println(e.getMessage());
            throw new DAOExcepcion(e.getMessage());
        } finally {
            this.cerrarStatement(stmt);
            this.cerrarConexion(con);
        }
    }
View Full Code Here

Examples of upc.iluminados.excepcion.DAOExcepcion

                vo.setApellidoMaterno(rs.getString(4));
              vo.setTipo(rs.getInt(5));
            }
        } catch (SQLException e) {
            System.err.println(e.getMessage());
            throw new DAOExcepcion(e.getMessage());
        } finally {
            this.cerrarResultSet(rs);
            this.cerrarStatement(stmt);
            this.cerrarConexion(con);
        }
View Full Code Here

Examples of upc.iluminados.excepcion.DAOExcepcion

                vo.setApellidoPaterno(rs.getString(3));
                vo.setApellidoMaterno(rs.getString(4));
            }
        } catch (SQLException e) {
            System.err.println(e.getMessage());
            throw new DAOExcepcion(e.getMessage());
        } finally {
            this.cerrarResultSet(rs);
            this.cerrarStatement(stmt);
            this.cerrarConexion(con);
        }
View Full Code Here

Examples of upc.iluminados.excepcion.DAOExcepcion

                vo.setApellidoMaterno(rs.getString(4));
              vo.setTipo(rs.getInt(5));
            }
        } catch (SQLException e) {
            System.err.println(e.getMessage());
            throw new DAOExcepcion(e.getMessage());
        } finally {
            this.cerrarResultSet(rs);
            this.cerrarStatement(stmt);
            this.cerrarConexion(con);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.