表格存储服务 CloudTable-删除表:代码样例

时间:2023-11-01 16:16:51

代码样例

public void dropTable() {   LOG .info("Entering dropTable.");  Admin admin = null;  try {    admin = conn.getAdmin();    if (admin.tableExists(tableName)) {      // Disable the table before deleting it.      admin.disableTable(tableName);      // Delete table.      admin.deleteTable(tableName);//注[1]    }    LOG.info("Drop table successfully.");  } catch (IOException e) {    LOG.error("Drop table failed " ,e);  } finally {    if (admin != null) {      try {        // Close the Admin object.        admin.close();      } catch (IOException e) {        LOG.error("Close admin failed " ,e);      }    }  }  LOG.info("Exiting dropTable.");}
support.huaweicloud.com/devg-cloudtable/cloudtable_01_0054.html