Package org.mapache.data

Examples of org.mapache.data.DAOException


            stmt.setString(4, newUser.getPassword());
            stmt.setString(5, newUser.getEmail());
            stmt.setString(6, newUser.getHomepage());
            stmt.execute();
        } catch (SQLException e) {
            throw new DAOException("Unable to create new user in database ",
                                   e);
        }
    }
View Full Code Here


            stmt =
MySQLDAOFactory.createConnection().prepareStatement(DELETE_USER);
            stmt.setInt(1, user.getUserID());
            stmt.execute();
        } catch (SQLException e) {
            throw new DAOException("Unable to delete User with UserNumber " +
                                   user.getUserID(), e);
        }
    }
View Full Code Here

            stmt.setInt(1, userNumber);
            ResultSet found = stmt.executeQuery();
            if (found.next())
                user = fetchUser(found);
        } catch (SQLException e) {
            throw new DAOException("Unable to find User with UserNumber " +
                                   userNumber, e);
        }

        return user;
    }
View Full Code Here

            stmt.setString(5, user.getEmail());
            stmt.setString(6, user.getHomepage());
            stmt.setInt(7, user.getUserID());
            stmt.execute();
        } catch (SQLException e) {
            throw new DAOException("Unable to update User with UserNumber " +
                                   user.getUserID(), e);
        }
    }
View Full Code Here

            stmt =
MySQLDAOFactory.createConnection().prepareStatement(SELECT_USERS);
            ResultSet users = stmt.executeQuery();
            list = fetchUsers(users);
        } catch (SQLException e) {
            throw new DAOException("Unable to collect Users", e);
        }

        return list;
    }
View Full Code Here

TOP

Related Classes of org.mapache.data.DAOException

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.