Package com.dbxml.db.client

Examples of com.dbxml.db.client.ResultSetClient


               case 0:  style = XPathQueryResolver.STYLE_XPATH;       break;
               case 1:  style = FullTextQueryResolver.STYLE_FULLTEXT; break;
               case 2:  style = XSLTQueryResolver.STYLE_XSLT;         break;
               default: style = XUpdateQueryResolver.STYLE_XUPDATE;   break;
            }
            ResultSetClient rs = col.queryCollection(style, query, cfg.getNamespaceMap());

            sw.stop();
            statusBar.setText(sw.toString());

            Document doc = DOMHelper.newDocument();
            Element root = doc.createElementNS(Query.NSURI, Query.PREFIX+":"+ResultSetWrapper.RESULTS);
            String colName = rs.getCollection().getCanonicalName();
            root.setAttribute("xmlns:"+Query.PREFIX, Query.NSURI);
            root.setAttribute(ResultSetWrapper.COL, colName);
            int count = rs.getCount();
            if ( count != -1 )
               root.setAttribute(ResultSetWrapper.COUNT, Integer.toString(count));
            doc.appendChild(root);
            root.appendChild(doc.createTextNode("\n"));

            while ( rs.next() ) {
               Node n = rs.getResult();
               Element result = doc.createElementNS(Query.NSURI, Query.PREFIX+":"+ResultSetWrapper.RESULT);
               result.appendChild(doc.createTextNode("\n"));
               CollectionClient rc = rs.getResultCollection();
               String rsColName = rc.getCanonicalName();
               if ( !rsColName.equals(colName) )
                  result.setAttribute(ResultSetWrapper.COL, rsColName);
               String key = rs.getResultKey();
               if ( key != null && key.length() > 0 )
                  result.setAttribute(ResultSetWrapper.KEY, key);
               result.appendChild(doc.importNode(n, true));
               result.appendChild(doc.createTextNode("\n"));
               root.appendChild(result);
View Full Code Here


            }
         }

         BodyContent content = getBodyContent();
         String query = content.getString();
         ResultSetClient rs;
         if ( key != null )
            rs = col.queryDocument(style, query, nsMap, key);
         else
            rs = col.queryCollection(style, query, nsMap);

         if ( name != null )
            pageContext.setAttribute(name, rs);
         else {
            while ( rs.next() ) {
               if ( html ) {
                  Node n = rs.getResult();
                  TextWriter.writeHTML(n, pageContext.getOut());
               }
               else
                  pageContext.getOut().write(rs.getResultAsText());
            }
         }
      }
      catch ( Exception e ) {
         System.out.println(e);
View Full Code Here

TOP

Related Classes of com.dbxml.db.client.ResultSetClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.