You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by John Zoetebier <jo...@transparent.co.nz> on 2003/12/13 10:39:03 UTC

Can someone give example for QueryLoader ?

JavaDoc say about QueryLoader:
==>
QueryLoader loads properties files filled with query name to SQL mappings. 
It acts as a registry for sets of queries so
that multiple copies of the same queries aren't loaded into memory. This 
class is thread safe.
==>

Can someone give an example of what this means ?

-- 
John Zoetebier
Web site: http://www.transparent.co.nz

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [dbutils] Can someone give example for QueryLoader ?

Posted by David Graham <gr...@yahoo.com>.
QueryLoader loads queries once and every subsequent request for them uses
the cached copy to avoid IO and object creation.  Your data access classes
can call QueryLoader.load() to retrieve the query map and use the queries
in QueryRunner like this:

runner.query(queries.get("findPeople"), rsh);

Please prefix all messages to commons-user and commons-dev with the
component name in brackets like [dbutils].

David

--- John Zoetebier <jo...@transparent.co.nz> wrote:
> JavaDoc say about QueryLoader:
> ==>
> QueryLoader loads properties files filled with query name to SQL
> mappings. 
> It acts as a registry for sets of queries so
> that multiple copies of the same queries aren't loaded into memory. This
> 
> class is thread safe.
> ==>
> 
> Can someone give an example of what this means ?
> 
> -- 
> John Zoetebier
> Web site: http://www.transparent.co.nz
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org