org.apache.phoenix phoenix-core4.15.0-Hbase-1.4
public class Demo01 { public static void main(String[] args) throws Exception { Connection conn = DriverManager.getConnection("jdbc:phoenix:master,node1,node2:2181"); String sql = "select * from DIANXIN where end_date=?"; PreparedStatement statement = conn.prepareStatement(sql); statement.setString(1,"20180503154014"); ResultSet resultSet = statement.executeQuery(); while (resultSet.next()) { String mdn = resultSet.getString("mdn"); String start_date = resultSet.getString("start_date"); String end_date = resultSet.getString("end_date"); String x = resultSet.getString("x"); String y = resultSet.getString("y"); String county = resultSet.getString("county"); String res = mdn + "t" + start_date + "t" + end_date + "t" + x + "t" + y + "t" + county; System.out.println(res); } resultSet.close(); conn.close(); statement.close(); } }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)