<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Hive jdbc connection string in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-jdbc-connection-string/m-p/99612#M12758</link>
    <description>&lt;P&gt;Thank you &lt;A rel="user" href="https://community.cloudera.com/users/63/amiller.html" nodeid="63"&gt;@Alex Miller&lt;/A&gt; I imported the Knox SSl certificate into cacerts and used the below connection string .&lt;/P&gt;&lt;P&gt;(
                                         "jdbc:hive2://knoxserver.net:443/;ssl=true;transportMode=http;httpPath=knox/nn01/hive",
                                         "username", "pwd");&lt;/P&gt;&lt;P&gt;It finally worked.. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 17 Dec 2015 13:27:41 GMT</pubDate>
    <dc:creator>pooja_khandelwa</dc:creator>
    <dc:date>2015-12-17T13:27:41Z</dc:date>
    <item>
      <title>Hive jdbc connection string</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-jdbc-connection-string/m-p/99604#M12750</link>
      <description>&lt;P&gt;I am trying to connect to hive through a java program using the below connection string. It was working fine until the hdp upgrade to 2.3.&lt;/P&gt;&lt;P&gt;jdbc:hive2://knoxserver.net:8443/default;ssl=false;transportMode=http;httpPath=knox/sandbox/hive",
                "knoxusername", "knoxuserpwd"&lt;/P&gt;&lt;P&gt;I am able to execute the connection string through beeline as below.&lt;/P&gt;&lt;P&gt;"jdbc:hive2://m1.hdp.local:10010/&amp;lt;db&amp;gt;;principal=hive/_HOST@HDP.LOCAL;transportMode=http;httpPath=cliservice"&lt;/P&gt;&lt;P&gt;but that works only when I do a kinit from the edge node. But I want the coneection string to work in the java program without doing kinit. Also the connection string I mentioned in my question is giving a invalid connection string error in beeline. In java program I am getting the below error.&lt;/P&gt;&lt;P&gt;Exception in thread "main" java.sql.SQLException: Could not open connection to jdbc:hive2://hive2://knoxserver.net:8443/default;ssl=false;transportMode=http;httpPath=knox/sandbox/hive: null at org.apache.hive.jdbc.HiveConnection.openTransport(HiveConnection.java:206) at org.apache.hive.jdbc.HiveConnection.&amp;lt;init&amp;gt;(HiveConnection.java:178) at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:105) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at find_file_by_filename.main(find_file_by_filename.java:51) Caused by: org.apache.thrift.transport.TTransportException at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:132) at org.apache.thrift.transport.TTransport.readAll(TTransport.java:84) at org.apache.thrift.transport.TSaslTransport.receiveSaslMessage(TSaslTransport.java:178) at org.apache.thrift.transport.TSaslTransport.open(TSaslTransport.java:288) at org.apache.thrift.transport.TSaslClientTransport.open(TSaslClientTransport.java:37) at org.apache.hive.jdbc.HiveConnection.openTransport(HiveConnection.java:203) ... 5 more&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2015 21:06:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-jdbc-connection-string/m-p/99604#M12750</guid>
      <dc:creator>pooja_khandelwa</dc:creator>
      <dc:date>2015-12-16T21:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: Hive jdbc connection string</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-jdbc-connection-string/m-p/99605#M12751</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/1499/poojakhandelwal.html" nodeid="1499"&gt;@pooja khandelwal&lt;/A&gt; What is the error are you getting? &lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2015 21:11:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-jdbc-connection-string/m-p/99605#M12751</guid>
      <dc:creator>pardeep_kumar</dc:creator>
      <dc:date>2015-12-16T21:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: Hive jdbc connection string</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-jdbc-connection-string/m-p/99606#M12752</link>
      <description>&lt;P&gt;I am able to execute the connection string thirugh beeline as below.&lt;/P&gt;&lt;P&gt;"jdbc:hive2://m1.hdp.local:10010/&amp;lt;db&amp;gt;;principal=hive/_HOST@HDP.LOCAL;transportMode=http;httpPath=cliservice"&lt;/P&gt;&lt;P&gt;but that works only when I do a kinit from the edge node. But I want the coneection string to work in the java program without doing kinit. Also the connection string I mentioned in my question is giving a invalid connection string error in beeline. In java program I am getting the below error.&lt;/P&gt;&lt;P&gt;Exception in thread "main" java.sql.SQLException: Could not open connection to jdbc:hive2://hive2://knoxserver.net:8443/default;ssl=false;transportMode=http;httpPath=knox/sandbox/hive: null
at org.apache.hive.jdbc.HiveConnection.openTransport(HiveConnection.java:206)
at org.apache.hive.jdbc.HiveConnection.&amp;lt;init&amp;gt;(HiveConnection.java:178)
at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:105)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at find_file_by_filename.main(find_file_by_filename.java:51)
Caused by: org.apache.thrift.transport.TTransportException
at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:132)
at org.apache.thrift.transport.TTransport.readAll(TTransport.java:84)
at org.apache.thrift.transport.TSaslTransport.receiveSaslMessage(TSaslTransport.java:178)
at org.apache.thrift.transport.TSaslTransport.open(TSaslTransport.java:288)
at org.apache.thrift.transport.TSaslClientTransport.open(TSaslClientTransport.java:37)
at org.apache.hive.jdbc.HiveConnection.openTransport(HiveConnection.java:203)
... 5 more&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2015 21:17:33 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-jdbc-connection-string/m-p/99606#M12752</guid>
      <dc:creator>pooja_khandelwa</dc:creator>
      <dc:date>2015-12-16T21:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: Hive jdbc connection string</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-jdbc-connection-string/m-p/99607#M12753</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/1499/poojakhandelwal.html" nodeid="1499"&gt;@pooja khandelwal&lt;/A&gt; If you look closely, the connection string is having two "hive2://". So are you sure that you are building correct connection string in your java program? Would you mind posting the connection code snippet of you program?&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2015 22:27:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-jdbc-connection-string/m-p/99607#M12753</guid>
      <dc:creator>VR46</dc:creator>
      <dc:date>2015-12-16T22:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: Hive jdbc connection string</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-jdbc-connection-string/m-p/99608#M12754</link>
      <description>&lt;P&gt;I changed the connection string to below.&lt;/P&gt;&lt;P&gt;"jdbc:hive2://knoxserver.net:443/default;ssl=false;hive.server2.transport.mode=http;hive.server2.thrift.http.path=knox/sandbox/hive", "username", "pwd"&lt;/P&gt;&lt;P&gt;And getting the below error.&lt;/P&gt;&lt;P&gt;INFO: Transport Used for JDBC connection: null
Exception in thread "main" java.sql.SQLException: Could not open client transport with JDBC Uri: jdbc:hive2://knoxserver.net:443/default;ssl=false;hive.server2.transport.mode=http;hive.server2.thrift.http.path=knox/sandbox/hive: null
at org.apache.hive.jdbc.HiveConnection.openTransport(HiveConnection.java:237) &lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2015 00:25:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-jdbc-connection-string/m-p/99608#M12754</guid>
      <dc:creator>pooja_khandelwa</dc:creator>
      <dc:date>2015-12-17T00:25:13Z</dc:date>
    </item>
    <item>
      <title>Re: Hive jdbc connection string</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-jdbc-connection-string/m-p/99609#M12755</link>
      <description>&lt;P&gt;Try:&lt;/P&gt;&lt;P&gt; "jdbc:hive2://knoxserver.net:443/;ssl=false;transportMode=http;httpPath=knox/sandbox/hive", "username", "pwd"&lt;/P&gt;&lt;P&gt;This assumes a few things that you should double check:&lt;/P&gt;&lt;OL&gt;
&lt;LI&gt;You actually have SSL disabled in knox.  Check ssl.enabled in gateway-site.xml.  Otherwise use transportMode=https;sslTrustStore=&amp;lt;trustStoreFileName&amp;gt;;trustStorePassword=&amp;lt;trustStorePassword&amp;gt;.  The &amp;lt;trustStoreFileName&amp;gt; and &amp;lt;trustStorePassword&amp;gt; need to be replaced with the real values from your system.  This trust store needs to contain the public certificate used by the Knox server.
&lt;/LI&gt;&lt;LI&gt;You have gatway.path in gateway.site.xml set to knox.  The default is gateway.  Otherwise use httpPath=gateway/sandbox/hive&lt;/LI&gt;&lt;LI&gt;Your topology file is named sandbox.xml.  If for example you are using Ambari your topology file is probably named default.xml so you would use httpPath=knox/default/hive or gateway/default/hive as per #2.&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Thu, 17 Dec 2015 01:55:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-jdbc-connection-string/m-p/99609#M12755</guid>
      <dc:creator>kevin_minder</dc:creator>
      <dc:date>2015-12-17T01:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: Hive jdbc connection string</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-jdbc-connection-string/m-p/99610#M12756</link>
      <description>&lt;P&gt;To remove the need for sslTrustStore &amp;amp; trustStorePassword you could also import the Knox SSL certificate as trusted into the cacerts truststore used by your java application, or use a CA-signed cert.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2015 02:13:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-jdbc-connection-string/m-p/99610#M12756</guid>
      <dc:creator>amiller</dc:creator>
      <dc:date>2015-12-17T02:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: Hive jdbc connection string</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-jdbc-connection-string/m-p/99611#M12757</link>
      <description>&lt;P&gt;Ok. So the transport mode is not being conveyed while opening a hive connection. Reason: "hive.server2.transport.mode=http". If you'd use "transportMode=http" (like &lt;A rel="user" href="https://community.cloudera.com/users/190/kevinminder.html" nodeid="190"&gt;@Kevin Minder&lt;/A&gt; has suggested below), it might just work. You should also use "httpPath=..." instead of "hive.server2.thrift.http.path=...".&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;Source: &lt;A target="_blank"&gt;https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Clients#HiveServer2Clients-JDBC&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2015 04:13:55 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-jdbc-connection-string/m-p/99611#M12757</guid>
      <dc:creator>VR46</dc:creator>
      <dc:date>2015-12-17T04:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: Hive jdbc connection string</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-jdbc-connection-string/m-p/99612#M12758</link>
      <description>&lt;P&gt;Thank you &lt;A rel="user" href="https://community.cloudera.com/users/63/amiller.html" nodeid="63"&gt;@Alex Miller&lt;/A&gt; I imported the Knox SSl certificate into cacerts and used the below connection string .&lt;/P&gt;&lt;P&gt;(
                                         "jdbc:hive2://knoxserver.net:443/;ssl=true;transportMode=http;httpPath=knox/nn01/hive",
                                         "username", "pwd");&lt;/P&gt;&lt;P&gt;It finally worked.. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2015 13:27:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-jdbc-connection-string/m-p/99612#M12758</guid>
      <dc:creator>pooja_khandelwa</dc:creator>
      <dc:date>2015-12-17T13:27:41Z</dc:date>
    </item>
  </channel>
</rss>

