Connect with teradatasqlalchemy while using integrated security

Connectivity
Connectivity covers the mechanisms for connecting to the Teradata Database, including driver connectivity via JDBC or ODBC.
JvS
Fan

Connect with teradatasqlalchemy while using integrated security

While trying to switch from the sqlalchemy-teradata to the teradatasqlalchemy package I encountered a problem using Integrated Security as the connection mechanisme. 

 

Using sqlalchemy-teradata I could do:

from sqlalchemy import create_engine

engine = create_engine(‘teradata://hostname/?trusted_connection=yes’, echo=True)

 

Using teradatasqlalchemy this no longer works:

from sqlalchemy import create_engine

engine = create_engine(‘teradatasql://hostname/?trusted_connection=yes’, echo=True)

 

sqlalchemy.exc.OperationalError: (teradatasql.OperationalError) Unable to parse JSON connection parameters
at gosqldriver/teradatasql.ParseConParams ConParams.go:53
at gosqldriver/teradatasql.(*teradataDriver).Open TeradataDriver.go:24
at database/sql.dsnConnector.Connect sql.go:600
at database/sql.(*DB).conn sql.go:1103
at database/sql.(*DB).Conn sql.go:1619
at main.goCreateConnection goside.go:180
at main._cgoexpwrap_545a47f24425_goCreateConnection _cgo_gotypes.go:188
at runtime.call64 asm_amd64.s:574
at runtime.cgocallbackg1 cgocall.go:316
at runtime.cgocallbackg cgocall.go:194
at runtime.cgocallback_gofunc asm_amd64.s:826
at runtime.goexit asm_amd64.s:2361
Caused by json: unknown field "trusted_connection"
(Background on this error at: http://sqlalche.me/e/e3q8)

 

I could not find any mention of this on https://pypi.org/project/teradatasql/ or https://pypi.org/project/teradatasqlalchemy/

 

Is this connection mechanism still supported in the terradatasql package?


Accepted Solutions
Highlighted
JvS
Fan

Re: Connect with teradatasqlalchemy while using integrated security

I found the answer here: http://knowledge.teradata.com/KCS/id/KCS012484

 

2.Example to use Kerberos logon mecanism : jdbc:teradata://MyTDBMS/LOGMECH=KRB5,TMODE=TERA,LOG=DEBUG

3.In JDBC integrated security functionality is performed by Kerberos

 

So for my example this would be:

from sqlalchemy import create_engine

engine = create_engine(‘teradatasql://hostname/?logmech=KRB5’, echo=True)

 

1 ACCEPTED SOLUTION
1 REPLY 1
Highlighted
JvS
Fan

Re: Connect with teradatasqlalchemy while using integrated security

I found the answer here: http://knowledge.teradata.com/KCS/id/KCS012484

 

2.Example to use Kerberos logon mecanism : jdbc:teradata://MyTDBMS/LOGMECH=KRB5,TMODE=TERA,LOG=DEBUG

3.In JDBC integrated security functionality is performed by Kerberos

 

So for my example this would be:

from sqlalchemy import create_engine

engine = create_engine(‘teradatasql://hostname/?logmech=KRB5’, echo=True)