HBase API 之 表数据操作
前置博客(必读) HBase API之表操作 具体代码 向表中插入数据 功能代码 public static void addRowData ( String tableName , String rowKey , String columnFamily , String column , String value ) throws IOException { //创建HTable对象 Table table = conn . getTable ( TableName . valueOf ( tableName ) ) ; //向表中插入数据 Put put = new Put ( Bytes . toBytes ( rowKey ) ) ; //向Put对象中组装数据 put . addColumn ( Bytes . toBytes ( columnFamily ) , Bytes . toBytes ( column ) , Bytes . toBytes ( value ) ) ; table . put ( put ) ; table . close ( ) ; System . out . println ( "插入数据成功" ) ; } 测试代码 @Test public void addRowData ( ) throws IOException {