Using User Name And Password

This authentication mechanism requires a user name and a password.

You provide this information to the connector in the connection URL. For more information about the syntax of the connection URL, see Building the Connection URL.

Note:

This authentication mechanism is available only for Hive Server 2.

To configure User Name And Password authentication:

  1. Set the AuthMech property to 3.
  2. Set the transportMode property to the transport protocol that you want to use in the Thrift layer.
  3. If you set the transportMode property to http, then set the httpPath property to the partial URL corresponding to the Hive server. Otherwise, do not set the httpPath property.
  4. Set the UID property to an appropriate user name for accessing the Hive server.
  5. Set the PWD property to the password corresponding to the user name you provided.

For example, the following connection URL connects to a Hive server with authentication enabled:

jdbc:hive2://node1.example.com:10001;AuthMech=3;
transportMode=http;httpPath=cliservice;UID=hs2;PWD=simba;

jdbc:hive://node1.example.com:10000;AuthMech=3;transportMode=http;httpPath=cliservice;UID=hive;PWD=simba;

In this example, user name and password authentication is enabled for JDBC connections, the LDAP user name is hs2, the password is simba, and the server is listening on port 10001 for JDBC connections.