わかりました。Vertica のドキュメントを検索していますが、DSN を作成せずに ODBC に接続する方法が見つかりません。JDBC は別の問題のようです。それを行う方法がある場合、私はそれを見ていません。
問題は、接続文字列が Vertica ドライバーによって処理される必要があることをシステムが認識していないことです (ドライバーがあると仮定します)。DSN にはそれが既に指定されているため、それが機能するのです (私の経験に基づいた推測です)。
これは、JDBC の例です。
"jdbc:vertica://server:port/db?user=username&password=password&ssl=true"
JDBC 接続文字列は、Vertica を使用する必要があることをコードに知らせているようです。
ODBCに関する関連文書の一部を投稿させてください(フォーマットを許してください):
DSN パラメータ
次の表のパラメータは、すべてのユーザーおよびシステム DSN エントリに共通です。提供されている例は、Windows クライアント用です。
DSN パラメータを編集するには:
* UNIX and Linux users can edit the odbc.ini file. (See Creating an ODBC DSN for Linux and Solaris Clients.) The location of this file is specific to the driver manager.
* Windows users can edit the DSN parameters directly by opening the DSN entry in the Windows registry (for example, at HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\vmartdb). However, the Vertica-preferred method is to follow the steps in Creating an ODBC DSN for Windows Clients.
* Parameters can be set while making the connection using SQLDriverConnect().
sqlRet = SQLDriverConnect(sql_hDBC, 0, (SQLCHAR*)"DSN=VerticaSQL;BinaryDataTransfer=1",
SQL_NTS, szDNS, 1024,&nSize, SQL_DRIVER_NOPROMPT);
Note: In the connection string ';' is a reserved symbol. If you need to set multiple parameters as part of ConnSettings parameter use '%3B' in place of ';'. Also use '+' instead of spaces.
For Example:
sqlRet = SQLDriverConnect(sql_hDBC, 0, (SQLCHAR*)"DSN=VerticaSQL;BinaryDataTransfer=1;ConnSettings=
set+search_path+to+a,b,c%3 Bset+locale=ch;SSLMode=prefer", SQL_NTS,
szDNS, 1024,&nSize, SQL_DRIVER_NOPROMPT);
* Parameters can also be set and retrieved after the connection has been made using SQLConnect(). Parameters can be set and retrieved using SQLSetConnectAttr(),SQLSetStmtAttr(), SQLGetConnectAttr() and SQLGetStmtAttr() API calls.