Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Location getLocation(Image image)throws PersistenceException {
- if (image == null) {
- LOG.error("LocationDTO is null");
- throw new PersistenceException("");
- }
- try {
- getLocation.setLong(1, image.getLocation());
- ResultSet result = getLocation.executeQuery();
- LinkedList<Location> list = new LinkedList<Location>();
- while (result.next()) {
- 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")));
- }
- return list.get(0);
- } catch (SQLException e) {
- throw new PersistenceException(e.getMessage());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement