484950515253545556
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); } }
616263646566676869
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); } }
7778798081828384858687
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; }
9899100101102103104105106
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); } }
112113114115116117118119120121
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; }