Document doc = db.parse(in);
doc.getDocumentElement().normalize();
System.out.println("Root element " + doc.getDocumentElement().getNodeName());
NodeList shelterNodeList = doc.getElementsByTagName("shelter");
for (int s = 0; s < shelterNodeList.getLength(); s++) {//s < 5; s++) {
ProgramProfileInfo ppiToPersist = new ProgramProfileInfo();
Node shelterNode = shelterNodeList.item(s);
if (shelterNode.getNodeType() == Node.ELEMENT_NODE) {
Element shelter = (Element) shelterNode;
for (String tagName : ELEMENT_NAMES) {
//System.out.println("adding " + tagName);
addElement(shelter, tagName, ppiToPersist);
}
ppiToPersist.setFeedSource(2);
ppiToPersist.setUpdateTimeStamp(new Timestamp(System.currentTimeMillis()));
//System.out.println("Done with one shelter record, now persisting");
ppis.updateProgramProfileInfo_Shelter(ppiToPersist);
}
}
System.out.println("Read poll data loop ended");