Issues Programmatically Adding ODBC DSN to ODBC Administrator on Windows

So since no one answered this question, I'm going to go ahead and fill in what I ended up doing below, for people such as @gimpy who may be looking for a similar answer.

I ended up just going the route of registry keys, with a .reg file that is run to add the correct ODBC information. See below for a sample of what I put in the .reg file to make this work.

I'm going to mark this answer as the solution until/if someone is able to give me an answer to one of the other two approaches above, which I would find preferrable.

Windows Registry Editor Version 5.00 

[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources] 

"Non-Prod Impala Connection"="Cloudera ODBC Driver for Impala" 



[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\Non-Prod Impala Connection] 

"AllowHostNameCNMismatch"="1" 

"AllowSelfSignedServerCert"="1" 

"AsyncExecPollInterval"="10" 

"AuthMech"="1" 

"AutoReconnect"="1" 

"CheckCertRevocation"="1" 

"DelegateKrbCreds"="1" 

"DelegationUID"="" 

"DESCRIPTION"="" 

"Driver"="Cloudera ODBC Driver for Impala" 

"EnableSimulatedTransactions"=0 

"Host"="<ImpalaHost>" 

"KrbFQDN"="_HOST" 

"KrbRealm"="<Domain>" 

"KrbServiceName"="impala" 

"LCaseSspKeyName"="" 

"Port"="21050" 

"RowsFetchedPerBlock"="10000" 

"Schema"="<Database>" 

"ServicePrincipalCanonicalization"="1" 

"SocketTimeout"="30" 

"SSL"="1" 

"StringColumnLength"="32767" 

"TrustedCerts"="<CertificatePath>\rootca.cert.pem" 

"TSaslTransportBufSize"="1000" 

"UID"="" 

"UseKeytab"="0" 

"UseNativeQuery"="0" 

"UseOnlySSPI"="0" 

"UseSASL"="1" 

"UseSQLUnicodeTypes"="0" 

"UseSystemTrustStore"="1"