[Zope-DB] Proper way to do DB connections from external methods?
Dave Cinege
dcinege-mlists-dated-1091384343.081965 at psychosis.com
Tue Jul 27 14:18:59 EDT 2004
On Tuesday 27 July 2004 05:23, you wrote:
> On 2004-07-26 at 04:57:15 [+0200], Dave Cinege
> The best thing is to use connection objects and ZSQL methods unless you
> have a need for extremely dynamic queries in which case you can use an
Yes I do. There just doesn't seem to be any point to doing any of this in
dtml. Additionally I want this code to be consistent with the (much more
extensive) back end.
I have already thought that I can make a single ZSQL method and just pass the
entire SQL statement to it.That sounds a bit dirty....
> external method to call the DA directly.
DA? Hmmm <thumbs through Zope Book> Ah, ok Database Adapter.
I would *think* this would be a better way to do it. And when you say DA do
you mean I would interact directly with the DA product, opening my own
connctions, or with an existing Conneciton Object to a DA?
> Our mxODBCZopeDA has both query
> and execute methods for example which allow you to hook into Zope's
> transactional management but write your queries completely independently.
Any example snippets or docs on a standard way to interact with DA's?
(Again I'm using mysql)
Thanks,
Dave
More information about the Zope-DB
mailing list