Amazon Redshift는 2025년 11월 1일부터 새 Python UDF 생성을 더 이상 지원하지 않습니다. Python UDF를 사용하려면 이 날짜 이전에 UDF를 생성하세요. 기존 Python UDF는 정상적으로 계속 작동합니다. 자세한 내용은 블로그 게시물을 참조하세요.
AWS SDK와 함께 ListDatabases사용
다음 코드 예시는 ListDatabases의 사용 방법을 보여 줍니다.
- Java
-
- SDK for Java 2.x
-
GitHub에 더 많은 내용이 있습니다. AWS코드 예 리포지토리에서 전체 예를 찾고 설정 및 실행하는 방법을 배워보세요.
/**
* 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);
});
}
AWS SDK 개발자 가이드 및 코드 예시의 전체 목록은 AWS SDK와 함께 이 서비스 사용 섹션을 참조하세요. 이 주제에는 시작하기에 대한 정보와 이전 SDK 버전에 대한 세부 정보도 포함되어 있습니다.