does anyone know the format of an odbc connection string for vertica?

后端 未结 6 750
庸人自扰
庸人自扰 2020-12-30 09:21

I\'m using the following:

DRIVER={Vertica ODBC Driver 4.1};
SERVER=lnxtabdb01.xxxx.com;
PORT=5433;
DATABASE=vertica;
USER=dbadmin;
PASSWORD=vertica;
OPTION=3         


        
6条回答
  •  生来不讨喜
    2020-12-30 09:48

    The accepted answer describes a way to connect with the Vertica ODBC driver using a System DSN. It is possible to connect using just a connection string to directly configure the connection against the driver. The following connection string pattern has been tested against the Vertica ODBC Client Driver v6.1.2:

    Driver=Vertica;Server=MyVerticaServer;Port=5433;Database=MyVerticaDB;UID=foo;PWD=bar
    

    Port is optional:

    Driver=Vertica;Server=MyVerticaServer;Database=MyVerticaDB;UID=foo;PWD=bar
    

    Or, if you're doing this in .NET as I am, you can use this to format up the connection string from the necessary parameters:

    var connectionString = string.Format(
                "Driver=Vertica;Server={0};{1}Database={2};UID={3};PWD={4}",
                server,
                port == null ? string.Empty : string.Format("Port={0};", port),
                database,
                username,
                password);
    

提交回复
热议问题