//url地址标签:总结,preparedStatement,15,getString,url,resultSet,prepareStatement,connection From: https://www.cnblogs.com/wjzohou/p/17703479.html
String url="jdbc:phoenix:hadoop102,hadoop103,hadoop104:2181";
//配置对象 没同户名和密码
Properties properties = new Properties();
//获取连接
Connection connection = DriverManager.getConnection(url, properties);
//编译sql
PreparedStatement preparedStatement = connection.prepareStatement("select * from student");
// PreparedStatement preparedStatement = connection.prepareStatement("upsert into student values (sjz,wjz,20,henan)");
// 执行sql
ResultSet resultSet = preparedStatement.executeQuery();
//
//打印结果
while (resultSet.next()){
System.out.println(resultSet.getString(1)+":"+resultSet.getString(2)+":"+resultSet.getLong(3)+":"+resultSet.getString(4));
}
// preparedStatement.executeUpdate();
connection.close();
hbase连接