Advertisement
Guest User

Untitled

a guest
May 22nd, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. public Location getLocation(Image image)throws PersistenceException {
  2. if (image == null) {
  3. LOG.error("LocationDTO is null");
  4. throw new PersistenceException("");
  5.  
  6. }
  7. try {
  8. getLocation.setLong(1, image.getLocation());
  9. ResultSet result = getLocation.executeQuery();
  10. LinkedList<Location> list = new LinkedList<Location>();
  11.  
  12. while (result.next()) {
  13. list.add(new Location(result.getLong("ID"), result.getString("name"), result.getString("adress"), result.getString("place"), result.getString("Country"), result.getDouble("LATITUDE"), result.getDouble("LONGITUDE")));
  14.  
  15. }
  16. return list.get(0);
  17. } catch (SQLException e) {
  18.  
  19. throw new PersistenceException(e.getMessage());
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement