python - Pyodbc Connection Error -
code
this code have entered using python 2.6 in linux red hat 64bit
import pyodbc print pyodbc.datasources() print "connecting via odbc" conn = pyodbc.connect("driver={netezzasql};server=localhost;port=5480;database=database;uid=santiago;pwd=ha123;")
error
this true error received when running pyodbc. don't know language or means?
{'odbc': '', 'netezzasql': '/usr/local/nz_7.2.0.3/lib64/libnzodbc.so'} connecting via odbc traceback (most recent call last): file "connect.py", line 41, in <module> conn = pyodbc.connect("driver{netezzasql};server=localhost;port=5480;database=database;uid=santiago;pwd=ha123;") pyodbc.error: ('h00', '[h00] [unixodbc]sre n/rpr trbtsaeepy\xc8 (33) (sqldriverconnectw)')
obdcinst.ini
this obdcinst file used
[odbc drivers] netezzasql = installed [netezzasql] driver = /usr/local/nz_7.2.0.3/lib64/libnzodbc.so setup = /usr/local/nz_7.2.0.3/lib64/libnzodbc.so apilevel = 1 connectfunctions = yyn description = netezza odbc driver driverodbcver = 03.51 debuglogging = false logpath = /tmp unicodetranslationoption = utf8 charactertranslationoption = prefetch = 256 socket = 16384
obdc.ini
this odbc configuration file used
; ; odbc.ini ; [odbc data sources] nzsql = netezzasql [netezzasql] ;path of driver used database connection driver = /usr/local/nz_7.2.0.3/lib64/libnzodbc.so ;a decription used identify database connection properties. description = netezzasql odbc ;the name of machine or ip address database located. servername = 127.0.0.1 ;the port number connect. port = 5480 ;the name of database. database = dev ;the name of valid user. username = guest ;the password user. password = password ;only select sql statements allowed if field checked. readonly = false ;when option enabled , application bindtype same backend ;datatype query performance faster.query performance gain achieved ;only single select statements (not batch queries).it works in case when ;application bind type different backend datatype there restrictions on it. fastselect = false ;when set true, system tables included in available table list. showsystemtables = false ;when set true, use old (2.5) functionality returning schemas in sqltables. legacysqltables = false ;specifies login timeout in seconds. logintimeout = 0 ;specifies query timeout in seconds. querytimeout = 0 ;specifies date format follows - ; 1: ymd ; 2: mdy ; 3: dmy dateformat = 1 ;when selected, driver treats sql_c_numeric buffers sql_c_char buffers. numericaschar = false ;return sql_bit "1"/"0" when char. sqlbitonezero = false ;when enabled, replaces occurences of crlf, cr , lf single space. stripcrlf = false ;specifies level of security on system securitylevel = preferredunsecured ;name of root ca certificate. cacertfile = ;specifies maximum errors allowed. 0 value means no limit on loadmaxerrors value. ;loadmaxerrors = 1 ;if value true, rounds data of numeric columns precision exceeds precision defined. ;loadroundfraction = 0 [odbc] ianaappcodepage=4 installdir=/opt/odbc32v51 trace=0 tracedll=/opt/odbc32v51/lib/odbctrac.so tracefile=odbctrace.out usecursorlib=0
if else needed determine solution please let me know.
i can't tell error means don't recognize language either. however, netezza odbc port 5480, while specify 5668 in connection method. also, database want connect named "database"?
Comments
Post a Comment