[Zope-DB] Querying many DBs from one set of SQL methods?

Tom Jenkins tjenkins@devis.com
Tue, 18 Sep 2001 08:37:56 -0400


We use the Z Forwarding Database Adapter to allow one set of ZSQL 
methods to run queries against two different databases.

http://www.zope.org/Members/shai/ZForwardingDA


Stuart Nicholson wrote:
> The itch: I need to have a single set of Z SQL methods that can be run against multiple databases as part of a common web interface driven by data held in different client's
> databases. 
> 
> A problem: However when defining a Z SQL method you are required to select an existing Zope Database Connection instance that the SQL method will run against. 
> 
> A scatch?: To me (being something of a Zope novice), it would appear to scratch my itch I have to 'copy and paste' into different folders (say one per client), duplicating my
> common SQL methods, defining the appropriate DB Connection in each folder and then changing each duplicated SQL method to point to that connection. This seems a rather
> inelegant solution.
> 
> Is there a better way?: I haven't tried but imagine I can programatically change the DB Connection properties prior to running each request. Is this a viable solution? Will
> this work with multiple clients running the same query for example? Can anybody suggest a better solution?
> 
> Thanks in advance,
> 
> Stuart Nicholson
> Software Engineer
> Wireless Data
> 
> 
> ---------------------------------------------------------------------- 
> The information contained in this communication is intended solely for the use of the individual or entity to whom it is addressed and others authorised to receive it.  It may
> contain confidential or legally privileged information. 
> If you are not the intended recipient you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this information is
> strictly prohibited and may be unlawful. 
> If you have received this communication in error, please notify us immediately by responding to this email and then delete it from your system. 
> Wirelessdata Ltd is neither liable for the proper and complete transmission of the information contained in this communication nor for any delay in its receipt. 
> ---------------------------------------------------------------------- 
> 
> 
> _______________________________________________
> Zope-DB mailing list
> Zope-DB@zope.org
> http://lists.zope.org/mailman/listinfo/zope-db
> 



-- 
Tom Jenkins
devIS - Development Infostructure
http://www.devis.com