Package com.alexnevsky.hotel.dao.exception

Examples of com.alexnevsky.hotel.dao.exception.DAOException


    try {
      connection = this.daoFactory.getConnection();
      preparedStatement = prepareStatement(connection, SQL_DELETE, false, values);
      int affectedRows = preparedStatement.executeUpdate();
      if (affectedRows == 0) {
        throw new DAOException("Deleting CustomerAccount failed, no rows affected.");
      } else {
        customerAccount.setId(null);
      }
    } catch (SQLException e) {
      throw new DAOException(e);
    } finally {
      close(connection, preparedStatement);
    }
  }
View Full Code Here


      connection = this.daoFactory.getConnection();
      preparedStatement = prepareStatement(connection, sql, false, values);
      resultSet = preparedStatement.executeQuery();
      exist = resultSet.next();
    } catch (SQLException e) {
      throw new DAOException(e);
    } finally {
      close(connection, preparedStatement, resultSet);
    }

    return exist;
View Full Code Here

      resultSet = preparedStatement.executeQuery();
      if (resultSet.next()) {
        room = mapRoom(resultSet);
      }
    } catch (SQLException e) {
      throw new DAOException(e);
    } finally {
      close(connection, preparedStatement, resultSet);
    }

    return room;
View Full Code Here

      resultSet = preparedStatement.executeQuery();
      while (resultSet.next()) {
        rooms.add(mapRoom(resultSet));
      }
    } catch (SQLException e) {
      throw new DAOException(e);
    } finally {
      close(connection, preparedStatement, resultSet);
    }

    return rooms;
View Full Code Here

      resultSet = preparedStatement.executeQuery();
      while (resultSet.next()) {
        rooms.add(mapRoom(resultSet));
      }
    } catch (SQLException e) {
      throw new DAOException(e);
    } finally {
      close(connection, preparedStatement, resultSet);
    }

    return rooms;
View Full Code Here

      resultSet = preparedStatement.executeQuery();
      if (resultSet.next()) {
        customer = mapCustomer(resultSet);
      }
    } catch (SQLException e) {
      throw new DAOException(e);
    } finally {
      close(connection, preparedStatement, resultSet);
    }

    return customer;
View Full Code Here

      resultSet = preparedStatement.executeQuery();
      while (resultSet.next()) {
        users.add(mapCustomer(resultSet));
      }
    } catch (SQLException e) {
      throw new DAOException(e);
    } finally {
      close(connection, preparedStatement, resultSet);
    }

    return users;
View Full Code Here

      resultSet = preparedStatement.executeQuery();
      if (resultSet.next()) {
        form = mapForm(resultSet);
      }
    } catch (SQLException e) {
      throw new DAOException(e);
    } finally {
      close(connection, preparedStatement, resultSet);
    }

    return form;
View Full Code Here

    try {
      connection = this.daoFactory.getConnection();
      preparedStatement = prepareStatement(connection, SQL_INSERT, true, values);
      int affectedRows = preparedStatement.executeUpdate();
      if (affectedRows == 0) {
        throw new DAOException("Creating Form failed, no rows affected.");
      }
    } catch (SQLException e) {
      throw new DAOException(e);
    } finally {
      close(connection, preparedStatement);
    }
  }
View Full Code Here

    try {
      connection = this.daoFactory.getConnection();
      preparedStatement = prepareStatement(connection, SQL_DELETE, false, values);
      int affectedRows = preparedStatement.executeUpdate();
      if (affectedRows == 0) {
        throw new DAOException("Deleting Form failed, no rows affected.");
      } else {
        form.setId(null);
      }
    } catch (SQLException e) {
      throw new DAOException(e);
    } finally {
      close(connection, preparedStatement);
    }
  }
View Full Code Here

TOP

Related Classes of com.alexnevsky.hotel.dao.exception.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.