I am trying to figure out how to execute queries against ZMysqlDA connection through my python based product. I would really like to use the DA interface so that my product will work with any database connection. Can someone provide an example or tell me which method I should be calling? Thanks, Chris
Chris Bruce wrote:
I am trying to figure out how to execute queries against ZMysqlDA connection through my python based product. I would really like to use the DA interface so that my product will work with any database connection. Can someone provide an example or tell me which method I should be calling?
If you call the mysql connection object, you should get something that'll be useful to you :-) cheers, Chris
How do I get the connection object in Product? restrictedTraverse? Also, what do I call? Chris ----- Original Message ----- From: Chris Withers To: Chris Bruce Cc: zope@zope.org Sent: Tuesday, March 02, 2004 6:39 AM Subject: Re: [Zope] Running SQL agains tDA Chris Bruce wrote:
I am trying to figure out how to execute queries against ZMysqlDA connection through my python based product. I would really like to use the DA interface so that my product will work with any database connection. Can someone provide an example or tell me which method I should be calling?
If you call the mysql connection object, you should get something that'll be useful to you :-) cheers, Chris
Chris Bruce wrote:
How do I get the connection object in Product? restrictedTraverse?
Yup, or acquire it by a well known name.
Also, what do I call?
The thing you're just traversed to ;-) cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
Chris Bruce wrote at 2004-3-1 12:38 -0800:
I am trying to figure out how to execute queries against ZMysqlDA connection through my python based product.
I would not use the DA directly but indirectly via Z SQL Methods.
I would really like to use the DA interface so that my product will work with any database connection.
This would also hold for Z SQL Methods...
Can someone provide an example or tell me which method I should be calling?
You are interested in the "query" method of so called "database connections". Such connections are usually defined in the "db.py" module of the database adapter product. You get a "database connection" by calling a DA instance (i.e. "conn = DA()"). -- Dieter
participants (3)
-
Chris Bruce -
Chris Withers -
Dieter Maurer