I'm new to phoenix and hbase.hbase table and phoenix view works well and i can fetch data through phoenix. when I access jdbc to phoenix,it stucks.
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class Phoenix {
private static String driver = "org.apache.phoenix.jdbc.PhoenixDriver";
public static void main(String[] args) throws SQLException {
try {
Class.forName(driver);
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
Statement stmt = null;
ResultSet rs = null;
System.out.println("start...");
Connection con = DriverManager.getConnection("jdbc:phoenix:[my_cloud_server_ip]:2181");
System.out.println(con);
con.close();
}
}
(only one zookeeper server has public internet ip,so i write this ip there,does it matters?)
it prints "start..." and no response any more
BUT when when the url is "jdbc:phoenix:ip:2181" or "jdbc:phoenix:ip:2181/hbase"
i got no response
when i add some other words ,for example "jdbc:phoenix:ip:2181/balabala"
i got NULL POINTER EXCEPTION
why ?
I hope u can understand what i say:)