Reboot an Amazon RDS DB instance using an Amazon SDK - Amazon Relational Database Service
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Reboot an Amazon RDS DB instance using an Amazon SDK

The following code example shows how to reboot an Amazon RDS DB instance.

SDK for Java 2.x

There's more on GitHub. Find the complete example and learn how to set up and run in the Amazon Code Examples Repository.

public static void rebootInstance(RdsClient rdsClient, String dbInstanceIdentifier ) { try { RebootDbInstanceRequest rebootDbInstanceRequest = RebootDbInstanceRequest.builder() .dbInstanceIdentifier(dbInstanceIdentifier) .build(); RebootDbInstanceResponse instanceResponse = rdsClient.rebootDBInstance(rebootDbInstanceRequest); System.out.print("The database "+ instanceResponse.dbInstance().dbInstanceArn() +" was rebooted"); } catch (RdsException e) { System.out.println(e.getLocalizedMessage()); System.exit(1); } }
  • For API details, see RebootDBInstance in Amazon SDK for Java 2.x API Reference.

For a complete list of Amazon SDK developer guides and code examples, see Using this service with an Amazon SDK. This topic also includes information about getting started and details about previous SDK versions.