6.5 向表中插入数据
/**
* 向表中插入数据
*
* @param tableName
* @param rowKey
* @param cf
* @param column
* @param value
* @throws IOException
*/
private static void addData(String tableName, String rowKey, String cf, String column, String value) throws IOException {
Table table = conn.getTable(TableName.valueOf(tableName));
Put put = new Put(Bytes.toBytes(rowKey));
put.addColumn(Bytes.toBytes(cf), Bytes.toBytes(column), Bytes.toBytes(value));
table.put(put);
table.close();
}