This topic describes how to query the names of data tables in a Tablestore instance by using Tablestore SDK for Java.
Prerequisites
A client is initialized. For more information, see Initialize a Tablestore client.
Method
public ListTableResponse listTable() throws TableStoreException, ClientExceptionSample code
The following sample code provides an example on how to query the names of data tables in an instance and print the names:
public static void listTableExample(SyncClient client) {
ListTableResponse response = client.listTable();
for(String tableName : response.getTableNames()) {
System.out.println(tableName);
}
}References
For more information, see Query the names of time series tables.