}
PreparedStatement statement = con.prepareStatement(getQuery());
statement.setString(1, this.source);
ResultSet set = statement.executeQuery();
if (!set.next()) throw new ResourceNotFoundException("There is no resource with that key");
Response response = ObjectModelHelper.getResponse(objectModel);
Request request = ObjectModelHelper.getRequest(objectModel);
if (this.modifiedSince(set, request, response)) {
this.resource = set.getBinaryStream(1);
if (this.typeColumn != 0) {
this.mimeType = set.getString(this.typeColumn);
}
if (this.resource == null) {
throw new ResourceNotFoundException("There is no resource with that key");
}
}
this.doCommit = true;
} catch (Exception e) {
this.doCommit = false;
throw new ResourceNotFoundException("DatabaseReader error:", e);
}
}