[Zope] Mysql-Connection in Python-Script
sean.upton@uniontrib.com
sean.upton@uniontrib.com
Wed, 18 Dec 2002 11:47:45 -0800
This will work in a python product (and likely in external methods), but not
in Zope python scripts. I wouldn't suggest doing this unless you absolutely
know what you are doing and why you need this instead of using the ZMySQLDA
(and at that, you need to be mindful about how you do transactions).
The one place where I can see this being useful is in scripts creating
databases, and the best solution for this is likely an external method.
Sean
-----Original Message-----
From: AM [mailto:list_subscriber@neurobs.com]
Sent: Wednesday, December 18, 2002 11:26 AM
To: Lukas Pitschl
Cc: zope@zope.org
Subject: Re: [Zope] Mysql-Connection in Python-Script
import MySQLdb, _mysql
db_con = MySQLdb.connect (host = Self.server,
port = Self.port,
user = Self.user,
passwd = Self.password,
db = Self.db_name)
Unfortunately this is what I do in a python product. I dont know if
PyScripts will allow you to import MySQLdb modules. You could of course
always got he external scripts way and return the connection object ot
the calling script.
hth
AM
Lukas Pitschl wrote:
>I would like to use a Mysql-Connection in a Zope-Python-Script.
>Could someone explain how that works?
>
>I have to import some CSV-data into a database
>
>thanks in advance
>
>lukas
>
>
--
==================================================================
Aseem Mohanty
Neurobehavioral Systems Inc, 828 San Pablo Ave, Albany, CA 94706
(R) 510 7696011 (M) 510 3014871 (O) 510 5279231
==================================================================
"I saw `cout' being shifted "Hello world" times to the left and
stopped right there!!" -- Steve Gonedes
==================================================================
_______________________________________________
Zope maillist - Zope@zope.org
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 )