我安装了hortonworkshiveodbc驱动程序,并在数据源中创建了一个连接。我测试了一下,结果很成功。
我安装了pyodbc并编写了以下代码
import os, sys, pyodbc;
con = pyodbc.connect("DSN=MyCon")
我出错了
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
pyodbc.Error: ('HYC00', '[HYC00] [Hortonworks][ODBC] (11470) Transactions are not supported. (11470) (SQLSetConnnectAttr(SQL_ATTR_AUTOCOMMIT))')
我也试过了
import pyodbc, sys, os
pyodbc.pooling = False
pyodbc.autocommit = False
con = pyodbc.connect("DSN=MyCon")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
pyodbc.Error: ('HYC00', '[HYC00] [Hortonworks][ODBC] (11470) Transactions are not supported. (11470) (SQLSetConnnectAttr(SQL_ATTR_AUTOCOMMIT))')
也试过了
con = pyodbc.connect("DSN=Tenet", autocommit=False)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
pyodbc.Error: ('HYC00', '[HYC00] [Hortonworks][ODBC] (11470) Transactions are not supported. (11470) (SQLSetConnnectAttr(SQL_ATTR_AUTOCOMMIT))')
1条答案
按热度按时间afdcj2ne1#
我解决了。。。。。我不是删除我的问题,把答案放在这里
这是根据本书的建议完成的
https://code.google.com/p/pyodbc/issues/detail?id=162
多亏了凯尔·波特的建议。。。现在完全有道理了