Got it. Thanks.

-----Original Message-----
From: Henner Kollmann [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 14, 2003 3:52 PM
To: 'Julio Ortuzar O.'
Cc: [EMAIL PROTECTED]
Subject: AW: [dbforms] Record Count


No. 
Dbforms now uses the DataSourceFactory to get the data. With this you
can get data from different datasources, e.g. jdbc or xml. So the query
statement is'nt really usefull.

Another idea:
You can retrieve the current datasource from the session using

      DataSourceList    ds  = DataSourceList.getInstance(request);
      DataSourceFactory qry = ds.get(table, request);

Then you can ask the qry for the handler:

   DataSource src = qry.getDataHandler()

A call to src.size() will give you the count of records. 

ATTENTION: To get the size all records will be fetched!!!!! If there a
large number of records you need much time..

Regards,
Henner


> -----Urspr�ngliche Nachricht-----
> Von: Julio Ortuzar O. [mailto:[EMAIL PROTECTED]
> Gesendet: Dienstag, 14. Oktober 2003 19:45
> An: 'Henner Kollmann'
> Cc: [EMAIL PROTECTED]
> Betreff: RE: [dbforms] Record Count
> 
> 
> I see. Thanks Henner.
> 
> One more question:
> 
> Is there a way in which I can retrieve the complete query statement,
> i.e.,:
>       1- the part defined in dbforms-config.xml, plus 
>       2- the whereClause defined in dbform tag
> 
> So that I can do something for example like:
> 
> Select count(*)
> From (complete_retrieved_query_statement)
> 
> This is just so that I don't have to hard code the complete
> query again.
> 
> 
> Thanks!
> 
> Julio Ortuzar
> 
> 
> 
> -----Original Message-----
> From: Henner Kollmann [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, October 14, 2003 12:58 PM
> To: 'Julio Ortuzar O.'
> Cc: [EMAIL PROTECTED]
> Subject: AW: [dbforms] Record Count
> 
> 
> 
> Fetched with maxrows=0?
> 
> Otherwise this can not work. Dbforms do not know the the size
> of the resultset until all data is fetched. Only known is if 
> there are more records then shown. 
> 
> You can use rsv.isLastPage() to check for this. It will be
> true if lastpage is reached.
> 
> Attention: Works only with datalist navigation!
> 
> Regards,
> Henner
> 
> > -----Urspr�ngliche Nachricht-----
> > Von: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] Im Auftrag 
> > von Julio Ortuzar O.
> > Gesendet: Dienstag, 14. Oktober 2003 16:27
> > An: [EMAIL PROTECTED]
> > Betreff: [dbforms] Record Count
> > 
> > 
> > Hi I have tried to get a global record count on a query I
> have defined
> > in dbforms-config.xml file.
> > 
> > I tried with
> > 
> > <%= rsv_qry_asoex.size() %>
> > 
> > But,it only shows the amount of rows delimeted by the maxRows
> > attribute of the dbform tag (in case
> > maxRows>=rsv_qry_asoex.size()). I wouldn't think doing a
> > count(*) on the same query would be efficient since that
> information
> > must be stored somewhere.
> > 
> > Any ideas, clues???
> > 
> > Thanks,
> > 
> > Julio Ortuzar
> > 
> > 
> > 
> > 
> > -------------------------------------------------------
> > This SF.net email is sponsored by: SF.net Giveback Program.
> > SourceForge.net hosts over 70,000 Open Source Projects. See 
> the people
> > who have HELPED US provide better services: Click
> > here: http://sourceforge.net/supporters.php
> > _______________________________________________
> > DbForms Mailing List
> > 
> http://www.wap-force.net/dbforms
> 
> 
> 



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
DbForms Mailing List

http://www.wap-force.net/dbforms

Reply via email to