}
PreparedStatement statement = con.prepareStatement(getQuery());
statement.setString(1, this.source);
ResultSet set = statement.executeQuery();
if (set.next() == false) throw new ResourceNotFoundException("There is no resource with that key");
Response response = (Response) objectModel.get(Constants.RESPONSE_OBJECT);
Request request = (Request) objectModel.get(Constants.REQUEST_OBJECT);
if (this.modifiedSince(set, request, response)) {
this.resource = set.getBlob(1);
if (this.resource == null) {
throw new ResourceNotFoundException("There is no image with that key");
}
}
this.doCommit = true;
} catch (Exception e) {
getLogger().warn("Could not get resource from Database", e);
this.doCommit = false;
throw new ResourceNotFoundException("DatabaseReader error:", e);
}
}