public List<String> tableNames(Connection connection, String databaseName, String schemaName, String tableName,
                                   String[] types) {
        List<String> tableNames = new ArrayList<>();
        try (ResultSet resultSet = connection.getMetaData().getTables(databaseName, schemaName, tableName, types)) {
            while (resultSet.next()) {
                tableNames.add(resultSet.getString("TABLE_NAME"));
            }
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return tableNames;
    }
query table names

@param connection
@param databaseName
@param schemaName
@param tableName
@param types
@return
chat2db-server/chat2db-spi/src/main/java/ai/chat2db/spi/sql/SQLExecutor.java