<?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: Not able to connect phoenix  via java jdbc in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Not-able-to-connect-phoenix-via-java-jdbc/m-p/165349#M127714</link>
    <description>&lt;P&gt;thx ,@&lt;A href="https://community.hortonworks.com/users/157/rgelhausen.html"&gt;Randy Gelhausen&lt;/A&gt;,@&lt;A href="https://community.hortonworks.com/users/223/jelser.html"&gt;Josh Elser&lt;/A&gt;&lt;/P&gt;&lt;P&gt;i get this error "&lt;/P&gt;&lt;P&gt;Exception in thread "main" java.sql.SQLException: ERROR 103 (08004): Unable to establish connection&lt;/P&gt;&lt;P&gt;Caused by: java.io.IOException: java.lang.reflect.InvocationTargetException" , yes  i 'am using simple java app with maven pomfile but i get  always this error  .&lt;/P&gt;</description>
    <pubDate>Mon, 11 Apr 2016 22:46:31 GMT</pubDate>
    <dc:creator>nejmhadjmbarek</dc:creator>
    <dc:date>2016-04-11T22:46:31Z</dc:date>
    <item>
      <title>Not able to connect phoenix  via java jdbc</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Not-able-to-connect-phoenix-via-java-jdbc/m-p/165346#M127711</link>
      <description>&lt;P&gt;i'm  trying to connect to phoenix using java  jdbc , but i not succeed to etablish connection  ,there is  exemple show me how to write url of connection ??, i succeed to connect to phoenix by  using sqlline.py &lt;/P&gt;&lt;P&gt;". /sqlline.py node4.bigdatau:2181 "   this is my code java  , thx&lt;/P&gt;&lt;PRE&gt;  try {
Class.forName("org.apache.phoenix.jdbc.PhoenixDriver");
    }catch (ClassNotFoundException e) {
		System.out.println("Where is your  JDBC Driver?");
		e.printStackTrace();
	}
   conn =  DriverManager.getConnection(" jdbc:phoenix:195.154.55.93:2181");
    System.out.println("got connection");
&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Apr 2016 22:28:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Not-able-to-connect-phoenix-via-java-jdbc/m-p/165346#M127711</guid>
      <dc:creator>nejmhadjmbarek</dc:creator>
      <dc:date>2016-04-11T22:28:52Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to connect phoenix  via java jdbc</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Not-able-to-connect-phoenix-via-java-jdbc/m-p/165347#M127712</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/2068/nejmhadjmbarek.html" nodeid="2068"&gt;@nejm hadjmbarek&lt;/A&gt;, can you post the error you're seeing? From the above, it looks like you've forgotten to include the ZooKeeper znode for HBase: "/hbase-unsecure". Try with the following connection string instead: "jdbc:phoenix:195.154.55.93:2181:/hbase-unsecure".&lt;/P&gt;&lt;P&gt;If you need a simple simple java application (with maven pomfile) that embeds and uses the Phoenix JDBC driver, take a look &lt;A href="https://github.com/randerzander/PhoenixPerf"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2016 22:33:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Not-able-to-connect-phoenix-via-java-jdbc/m-p/165347#M127712</guid>
      <dc:creator>rgelhausen</dc:creator>
      <dc:date>2016-04-11T22:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to connect phoenix  via java jdbc</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Not-able-to-connect-phoenix-via-java-jdbc/m-p/165348#M127713</link>
      <description>&lt;P&gt;The leading space in your JDBC url is likely problematic.&lt;/P&gt;&lt;P&gt;If that doesn't fix it, you should provide the error you are experiencing.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2016 22:34:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Not-able-to-connect-phoenix-via-java-jdbc/m-p/165348#M127713</guid>
      <dc:creator>elserj</dc:creator>
      <dc:date>2016-04-11T22:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to connect phoenix  via java jdbc</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Not-able-to-connect-phoenix-via-java-jdbc/m-p/165349#M127714</link>
      <description>&lt;P&gt;thx ,@&lt;A href="https://community.hortonworks.com/users/157/rgelhausen.html"&gt;Randy Gelhausen&lt;/A&gt;,@&lt;A href="https://community.hortonworks.com/users/223/jelser.html"&gt;Josh Elser&lt;/A&gt;&lt;/P&gt;&lt;P&gt;i get this error "&lt;/P&gt;&lt;P&gt;Exception in thread "main" java.sql.SQLException: ERROR 103 (08004): Unable to establish connection&lt;/P&gt;&lt;P&gt;Caused by: java.io.IOException: java.lang.reflect.InvocationTargetException" , yes  i 'am using simple java app with maven pomfile but i get  always this error  .&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2016 22:46:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Not-able-to-connect-phoenix-via-java-jdbc/m-p/165349#M127714</guid>
      <dc:creator>nejmhadjmbarek</dc:creator>
      <dc:date>2016-04-11T22:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to connect phoenix  via java jdbc</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Not-able-to-connect-phoenix-via-java-jdbc/m-p/165350#M127715</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/2068/nejmhadjmbarek.html" nodeid="2068"&gt;@nejm hadjmbarek&lt;/A&gt; Remove the space inside connection string. Add zookeeper znode in the connection string .&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;jdbc:phoenix:&amp;lt;quorom&amp;gt;:&amp;lt;port&amp;gt;:[zk_rootNode]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If this doesn't work plz paste whole stack trace.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2016 06:11:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Not-able-to-connect-phoenix-via-java-jdbc/m-p/165350#M127715</guid>
      <dc:creator>ajay_kumar</dc:creator>
      <dc:date>2016-04-19T06:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to connect phoenix  via java jdbc</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Not-able-to-connect-phoenix-via-java-jdbc/m-p/165351#M127716</link>
      <description>&lt;P&gt;Hi &lt;A href="https://community.hortonworks.com/users/2068/nejmhadjmbarek.html" rel="nofollow noopener noreferrer" target="_blank"&gt;@nejm hadjmbarek&lt;/A&gt;, I'm Posting my code, which is working Fine:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="4469-2016-05-24.png" style="width: 666px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/20397i151C2C6D901D1ABB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="4469-2016-05-24.png" alt="4469-2016-05-24.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.PreparedStatement;
import java.sql.Statement;
public class phoenix_hbase 
{
 public static void main(String[] args) throws SQLException 
 {
  @SuppressWarnings("unused")
  Statement stmt = null;
  ResultSet rset = null;
 
  try 
  {
   Class.forName("org.apache.phoenix.jdbc.PhoenixDriver");
  } 
  catch (ClassNotFoundException e1) 
  {
   System.out.println("Exception Loading Driver");
   e1.printStackTrace();
  }
  try
  {
   Connection con = DriverManager.getConnection("jdbc:phoenix:172.31.124.43:2181:/hbase-unsecure");  //172.31.124.43 is the adress of VM, not needed if ur running the program from vm itself
   stmt = con.createStatement();
    
   PreparedStatement statement = con.prepareStatement("select * from javatest");
   rset = statement.executeQuery();
   while (rset.next()) 
   {
    System.out.println(rset.getString("mycolumn"));
   }
   statement.close();
   con.close();
  }
  catch(Exception e)
  {
   System.out.println(e.getMessage());
  }
 }
}
&lt;/PRE&gt;</description>
      <pubDate>Sun, 18 Aug 2019 11:20:40 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Not-able-to-connect-phoenix-via-java-jdbc/m-p/165351#M127716</guid>
      <dc:creator>rkm6677</dc:creator>
      <dc:date>2019-08-18T11:20:40Z</dc:date>
    </item>
  </channel>
</rss>

