package com.aws.jdbc;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class ConnectionHelper
{
    private String url;

    private static ConnectionHelper instance;
    private ConnectionHelper()
    {
        url = "jdbc:mysql://localhost:3306/mydb"; // REPLACE with URL to RDS instance
    }

    public static Connection getConnection() throws SQLException {
        if (instance == null) {
            instance = new ConnectionHelper();
        }
        try {

            Class.forName("com.mysql.jdbc.Driver").newInstance();
            return DriverManager.getConnection(instance.url, "root","root"); //REPLACE with user name and password to RDS instance
        }
        catch (Exception e) {
            e.getStackTrace();
        }
        return null;
    }
    public static void close(Connection connection)
    {
        try {
            if (connection != null) {
                connection.close();
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}

@@ -1,8 +1,535 @@
+/*%0A   Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.%0A   This file is licensed under the Apache License, Version 2.0 (the %22License%22).%0A   You may not use this file except in compliance with the License. A copy of%0A   the License is located at%0A    http://aws.amazon.com/apache2.0/%0A   This file is distributed on an %22AS IS%22 BASIS, WITHOUT WARRANTIES OR%0A   CONDITIONS OF ANY KIND, either express or implied. See the License for the%0A   specific language governing permissions and limitations under the License.%0A*/%0A
 package 

Update ConnectionHelper.java