Amazon Redshift non supporterà più la creazione di nuove UDF Python a partire dal 1º novembre 2025. Se desideri utilizzare le UDF Python, creale prima di tale data. Le UDF Python esistenti continueranno a funzionare normalmente. Per ulteriori informazioni, consulta il post del blog.
Utilizzo di ListDatabases con un SDK AWS
Gli esempi di codice seguenti mostrano come utilizzare ListDatabases.
- Java
-
- SDK per Java 2.x
-
/**
* Lists all databases asynchronously for the specified cluster, database user, and database.
* @param clusterId the identifier of the cluster to list databases for
* @param dbUser the database user to use for the list databases request
* @param database the database to list databases for
* @return a {@link CompletableFuture} that completes when the database listing is complete, or throws a {@link RuntimeException} if there was an error
*/
public CompletableFuture<Void> listAllDatabasesAsync(String clusterId, String dbUser, String database) {
ListDatabasesRequest databasesRequest = ListDatabasesRequest.builder()
.clusterIdentifier(clusterId)
.dbUser(dbUser)
.database(database)
.build();
// Asynchronous paginator for listing databases.
ListDatabasesPublisher databasesPaginator = getAsyncDataClient().listDatabasesPaginator(databasesRequest);
CompletableFuture<Void> future = databasesPaginator.subscribe(response -> {
response.databases().forEach(db -> {
logger.info("The database name is {} ", db);
});
});
// Return the future for asynchronous handling.
return future.exceptionally(exception -> {
throw new RuntimeException("Failed to list databases: " + exception.getMessage(), exception);
});
}
Per un elenco completo delle guide per gli sviluppatori di SDK AWS ed esempi di codice, consulta la sezione Utilizzo del servizio con un SDK AWS. Questo argomento include anche informazioni su come iniziare e dettagli sulle versioni precedenti dell'SDK.