我正在使用安装了cx_Oracle unicode版本的Debian 5,Python 2.5。我尝试使用下面的脚本,但它未能使用Python上的cx_Oracle连接到Oracle数据库
>>> connection = cx_Oracle.connect('hr/[email protected]_xe')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: argument 1 must be unicode, not str
我想是因为安装cx_Oracle是一个Unicode版本进行连接,它要求我指定Unicode作为第一个参数。但是,它不采取字符串,我不知道我可以提供其他什么?
尝试`cx_Oracle.connect(u'hr/XXXXX @ local_xe')`? – Sathya 2010-12-03 15:57:56