Re: [Zope] Change db connect string in python or dtml
Craig Allen wrote: > As a quick and dirty alternative (untested), just edit your connection > parameters in your Mysql connector to point to the different server (you'll want > to close the connection first, I expect). I think this is probably the best way to do it :-) The idea behind a database connector is that it abstracts the connection information into a seperate object so you only have to change the connection string in one place to change what DB a group of methods are using. As longs as the DBs have the same schema it should work just fine. cheers, Chris ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Change db connect string in python or dtml
Magnus Heino wrote: > How can I change the 'Database Connection String' and then then try to > connect, either in dtml or python? I think I understand what you are asking, since I am developing a database app and have switched about 20 methods back and forth between two database servers... it gets tedious. I assume you want a more automated way to do this, and it should be possible to write a python script (External method?) to do this, although I'm not sure how you would find all the ZSQL methods where you would do this. Perhaps something like this (the find form): http://www.yourserver.com/yourfolder/manage_findResult?obj_metatypes%3Alist=Z+Gadfly+Database+Connection&obj_ids%3Atokens=&obj_searchterm=&obj_mspec=%3C&obj_mtime=&search_sub%3Aint=1&btn_submit=Find As a quick and dirty alternative (untested), just edit your connection parameters in your Mysql connector to point to the different server (you'll want to close the connection first, I expect). -- Craig Allen - Managing Partner - Mutual Alchemy Web Architecture - http://alchemy.nu ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] Change db connect string in python or dtml
Title: RE: [Zope] Change db connect string in python or dtml Have you tried: create a new instance of a database connection alongside the old one, then point your SQL methods at the new connection. When you have them all switched over, delete the old connection. -cw- > -Original Message- > From: Magnus Heino [[EMAIL PROTECTED]] > Sent: Wednesday, August 02, 2000 5:50 AM > To: [EMAIL PROTECTED] > Subject: [Zope] Change db connect string in python or dtml > > > > Hi. > > I have an instance of a 'Z MySQL Database Connection' called mysql. > > How can I change the 'Database Connection String' and then then try to > connect, either in dtml or python? > > -- > > /Magnus Heino