This topic describes how to install and use RDS SDK for Java. RDS SDK for Java allows you to access your ApsaraDB for RDS instance without the need for complex programming.

Background information

Alibaba Cloud provides OpenAPI Explorer to simplify API usage. You can use OpenAPI Explorer to search for API operations, call API operations, and dynamically generate SDK sample code.


  • An AccessKey pair is created. For more information, see Create an AccessKey.
    Note To protect the AccessKey pair of your Alibaba Cloud account, we recommend that you create a RAM user, grant the RAM user the permissions to access ApsaraDB for RDS instances, and then use the AccessKey pair of the RAM user to call RDS SDK for Java. For more information, see Implement access control by using RAM.
  • Version 1.6 or later of Java is installed.

Install RDS SDK for Java

  1. Visit the Alibaba Cloud SDK for Java page at GitHub.
  2. Download the RDS SDK for Java package and install the SDK by following the instructions provided in the README file.


  1. Configure the following parameters:
    IClientProfile profile
                 = DefaultProfile.getProfile(
            "regonId",    // The ID of the region where your RDS instance resides.
            "accessKeyId",    // The AccessKey ID of your RAM user.
            "accessKeySecret"    // The AccessKey secret of your RAM user.
  2. Configure the endpoint that is used to connect to your RDS instance.
            "endpointName",    // The name of the endpoint.
            "regionId",    // The ID of the region where your RDS instance resides.
            "product(Rds)",    // The product code of ApsaraDB for RDS. Enter Rds.
            "domain(endpoint)"    // The endpoint.
    Note For more information, see Request structure.
  3. Configure the parameters that are used to initialize the request.

    For example, configure the following parameters to initialize the request that is used to call the DescribeDBInstanceAttribute operation:

    DescribeDBInstanceAttributeRequest request = new  DescribeDBInstanceAttributeRequest();
  4. Initiate the AcsClient.
    IAcsClient client = new DefaultAcsClient(profile);
  5. View the response.
    DescribeDBInstanceAttributeResponse response =client.getAcsResponse(request);


Sample request:

IClientProfile profile
                = DefaultProfile.getProfile("cn-hangzhou","Akxxxxx",
                "ap-southeast-5", "Rds", "");
        DescribeDBInstanceAttributeRequest request = new DescribeDBInstanceAttributeRequest();
        IAcsClient client = new DefaultAcsClient(profile);
        try {
            DescribeDBInstanceAttributeResponse response = client.getAcsResponse(request);
        }catch (ServerException e) {

        } catch (ClientException e) {

Sample response: