Package com.art.anette.exceptions

Examples of com.art.anette.exceptions.RegistrationFailedException


            String q = SQLFormatter.generateQuery("SELECT * FROM %s WHERE email = '%s'",
                    Employee.getTableName(), data.email);
            ResultSet rs = dbConnector.query(q);
            if (rs.next()) {
                throw new RegistrationFailedException("This email is already in system!");
            }
            rs.close();

            Employee e = new Employee(this, 0, 0, data);
            e.setState(Status.NEW);
            dbConnector.execute(e.toSQL(owner));
            rs = dbConnector.query("SELECT LAST_INSERT_ID() as id FROM " + Employee.getTableName());
            rs.next();

            e = new Employee(null, rs.getLong("id"), data);
            rs.close();

            SDBCPool.getInstance().inform(e);
            return e;

        } catch (SQLException ex) {
            logger.severe(null, ex);
            //noinspection ThrowInsideCatchBlockWhichIgnoresCaughtException
            throw new RegistrationFailedException("Error while checking logindata!");
        }
    }
View Full Code Here

TOP

Related Classes of com.art.anette.exceptions.RegistrationFailedException

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.