What version of hbase are you using? Can you pastebin your hbase-site.xml?
-- Sean On Mar 27, 2015 12:47 AM, "James Teng" <tenglinx...@outlook.com> wrote: > HI, > i tried to connect to local deployed hbase with my codes below, but can't > connect to it successfully. and attach the log data i can see from hbase > side. > if anyone give me any tip on it, will be very appreciating.thanks in > advance.uknow. > -----------java codes----------------import java.sql.Connection;import > java.sql.DriverManager;import java.sql.ResultSet;import > java.sql.SQLException;import java.sql.Statement; > public class Test { public static void main(String args[]) throws > SQLException { try { > Class.forName("org.apache.phoenix.jdbc.PhoenixDriver"); } catch > (ClassNotFoundException e) { e.printStackTrace(); > return; } Connection connection = > DriverManager > .getConnection("jdbc:phoenix:localhost:2181"); > System.out.println("step 1 ..."); Statement statement = > connection.createStatement(); ResultSet set = > statement.executeQuery("select * from user"); while (set.next()) > { System.out.println(set.getObject(1)); } > connection.close(); }}---------------------hbase logs > --------------------2015-03-27 15:45:27,144 INFO [NIOServerCxn.Factory: > 0.0.0.0/0.0.0.0:2181] server.NIOServerCnxnFactory: Accepted socket > connection from /0:0:0:0:0:0:0:1:568862015-03-27 15:45:27,150 INFO > [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181] server.ZooKeeperServer: > Client attempting to establish new session at > /0:0:0:0:0:0:0:1:568862015-03-27 15:45:27,157 INFO [SyncThread:0] > server.ZooKeeperServer: Established session 0x14c59bbda3c003d with > negotiated timeout 40000 for client /0:0:0:0:0:0:0:1:568862015-03-27 > 15:45:32,933 INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181] > server.NIOServerCnxnFactory: Accepted socket connection from > /fe80:0:0:0:0:0:0:1%1:568872015-03-27 15:45:32,933 INFO > [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181] server.ZooKeeperServer: > Client attempting to establish new session at > /fe80:0:0:0:0:0:0:1%1:568872015-03-27 15:45:32,942 INFO [SyncThread:0] > server.ZooKeeperServer: Established session 0x14c59bbda3c003e with > negotiated timeout 40000 for client /fe80:0:0:0:0:0:0:1%1:56887 >