skip to main content
Quick Start: Progress DataDirect for JDBC for Apache Hive Driver : Connecting to a DataSource : Connecting Using the DriverManager : Passing the Connection URL
  

Try DataDirect Drivers Now
Passing the Connection URL
After setting the CLASSPATH, the required connection information needs to be passed in the form of a connection URL. The form of the connection URL differs depending on whether you are using a binary or HTTP connection:
For binary connections (the default):
Connection conn = DriverManager.getConnection
(jdbc:datadirect:hive://servername:port;
DatabaseName=database;[property=value[;...]];)
For HTTP connections (TransportMode=http):
Connection conn = DriverManager.getConnection
(jdbc:datadirect:hive://servername:port;DatabaseName=database;
HTTPPath=path;TransportMode=http;[property=value[;...]];)
where:
servername
specifies the name or the IP address of the server to which you want to connect.
port
specifies the TCP port of the primary database server that is listening for connections to the Apache Hive database. The default is 10000 for binary connections and 10001 for HTTP.
database
specifies the name of the Apache Hive database to which you want to connect.
path
specifies the path of the HTTP/HTTPS endpoint used for connections. The default is cliservice.
property=value
specifies connection property settings. Multiple properties are separated by a semi-colon. For more information on connection properties, see "Using Connection Properties."
The following examples show how to establish a connection to an Apache Hive database.
For binary connections:
Connection conn = DriverManager.getConnection
("jdbc:datadirect:hive://MyServer:10000;DatabaseName=MyDB");
For HTTP connections:
Connection conn = DriverManager.getConnection
(jdbc:datadirect:hive://myserver:10001;DatabaseName=MyDB;
HTTPPath=cliservice;TransportMode=http);