db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ting ling" <tingling...@hotmail.com>
Subject OJB Query Problem
Date Wed, 22 Oct 2003 08:07:08 GMT
Hi,
I got some problem on retrieve data from a iterator.
my case is i need to create a fleasible table that base on user to define 
table column. setColumns() is used.

below is my code
     Collection results = new Vector();
     ReportQueryByCriteria q = 
QueryFactory.newReportQuery(LogReceiving.class, crit);
     q.setColumns(new String[]{"SUM(pieces) AS C1","SUM(price) AS C2"});
     q.addGroupBy("shipmentId");

     Iterator iter = broker.getReportQueryIteratorByQuery(q);
     while(iter.hasNext()){
          results.add(iter.next());
     }

this code can run and generate correct sql statement. but how i can retrieve 
and print data that store in results(Collection).

sql statement:
SELECT SUM(pieces) AS C1, SUM(price) AS C2, A0.SHIPMENT_ID FROM 
LOG_RECEIVING A0 GROUP BY A0.SHIPMENT_ID

_________________________________________________________________
Using a handphone prepaid card? Reload your credit online! 
http://www.msn.com.my/reloadredir/default.asp


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message