题目内容
public void insert() throws IOException{ Table table = conn.getTable(tName); ListputList = new ArrayList(); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); for(int i=1;i<20;i++){ String id=format.format(new Date()); id=id.replace("-", "").replace(" ", "").replace(":", ""); id = "student"+getRowKey(id); Put put = new Put(id.getBytes()); String name="Tom"+i; put.( ) ("cf1".getBytes(), "name".getBytes(), name.getBytes()); putList.( ) ; } table.put(putList); System.out.println("数据插入完成"); }
查看答案
搜索结果不匹配?点我反馈