@Override
    public void readFromDB(String file) {
        
        try{
            this.xmlFile = file;
            File xmlFile = new File(file);
            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
            DocumentBuilder db = dbf.newDocumentBuilder();
            Document doc = db.parse(xmlFile);
            
            
            NodeList nodeList = doc.getElementsByTagName("stock");
            
            
            //Get all the stock entries
            for (int count = 0 ; count < nodeList.getLength(); count++) {
            
                Node node = nodeList.item(count);
                if (node.getNodeType() == Node.ELEMENT_NODE) {
                    
                    Element element = (Element) node;
                    String stockId = element.getAttribute("id");
                    
                    
                    
                    
                    //Find tags... keep tag algorithm generic here to allow flexibility for evolving tag names.
                    //That's why we use "*" to query tag names.
                    NodeList tags = element.getElementsByTagName("*");
                    HashMap<String,String> realdata = new HashMap<String, String>();
                    for (int cnt = 0; cnt < tags.getLength(); cnt++) {
                        Element atag = (Element) tags.item(cnt);
                        String atagname = atag.getNodeName();
                      
                        realdata.put(atagname,element.getElementsByTagName(atagname).item(0).getTextContent() );
                    }
                    
                    dataContainer.put(stockId, realdata);
                
                }
                
               
                
            }
            
        }
        catch(Exception doh) {
            System.out.println(doh.getMessage());
        }
    }