skip to main content
Using the Driver : Connecting from an Application : HTTP Mode
  

Try DataDirect Drivers Now

HTTP Mode

In addition to the default thrift protocol (binary mode), the driver also supports HTTP mode, which allows you to access Apache Spark SQL data stores using HTTP/HTTPS requests. When HTTP mode is enabled, thrift RPC messages are sent to an endpoint using HTTP transport. HTTP mode is typically employed when there is a need to access data through a proxy server, such as when connecting to a load balancer or a gateway server. Unless otherwise noted, the same features and functionality are supported for both the thrift and HTTP protocols.
To connect to a server using HTTP Mode:
1. Configure the minimum required options required for a connection:
*Set the DatabaseName property to provide the name of the Apache Spark SQL database to which you want to connect.
*Set the ServerName property to provide the name or the IP address of the server to which you want to connect.
*Set the PortNumber property to provide the TCP port of the primary database server that is listening for connections to the Apache Spark SQL database. The default is 10000.
2. Set the TransportMode property to http.
3. Optionally, if not using the default HTTP endpoint, set the HTTPPath property to provide the path of the endpoint to be used for HTTP/HTTPS requests. The default is cliservice.
4. Optionally, if you are sending requests to HTTPS endpoints, set the EncryptionMethod property to ssl to enable SSL data encryption. Data encryption behavior can be further configured using the connection properties described in "Data Encryption Properties" in the user's guide.
The following example demonstrates a connection URL with HTTP mode and SSL enabled.
jdbc:datadirect:sparksql://myserver:10000;DatabaseName=mydb1;EncryptionMethod=ssl;
HTTPPath=warehouse;TransportMode=http;