Building the Connection URL
Use the connection URL to supply connection information to the data source that you are accessing. The following is the format of the connection URL for the Simba Apache Hive JDBC Connector, where [Subprotocol] is hive,hive2 if you are connecting to a Hive Server 2 instance, [Host] is the DNS or IP address of the Hive server, and [Port] is the number of the TCP port that the server uses to listen for client requests:
jdbc:[Subprotocol]://[Host]:[Port]
By default, Hive uses port 10000.
By default, the connector uses the schema named default and authenticates the connection using the user name anonymous.
You can specify optional settings such as the number of the schema to use or any of the connection properties supported by the connector. For a list of the properties available in the connector, see
If you specify a property that is not supported by the connector, then the connector attempts to apply the property as a Hive server-side property for the client session. For more information, see Configuring Server-Side Properties.
The following is the format of a connection URL that specifies some optional settings:
jdbc:[Subprotocol]://[Host]:[Port]/[Schema];[Property1]=[Value];[Property2]=[Value];...
For example, to connect to port 11000 on a Hive Server 2 instance installed on the local machine, use a schema named default2, and authenticate the connection using a user name and password, you would use the following connection URL:
jdbc:hive2://localhost:11000/default2;AuthMech=3;
UID=simba;PWD=simba
- Properties are case-sensitive.
- Do not duplicate properties in the connection URL.
- If you specify a schema in the connection URL, you can still issue queries on other schemas by explicitly specifying the schema in the query. To inspect your databases and determine the appropriate schema to use, run the
show databases
command at the Hive command prompt. - If you set the
transportMode
property tohttp
, then the port number specified in the connection URL corresponds to the HTTP port rather than the TCP port. By default, Hive servers use 10001 as the HTTP port number.
- Driver Configuration Options on page 1
- Configuring the Simba Apache Hive JDBC Connector on page 1
- Installing and Using the Simba Apache Hive JDBC Connector