/*
   Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
   This file is licensed under the Apache License, Version 2.0 (the "License").
   You may not use this file except in compliance with the License. A copy of
   the License is located at
    http://aws.amazon.com/apache2.0/
   This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
   CONDITIONS OF ANY KIND, either express or implied. See the License for the
   specific language governing permissions and limitations under the License.
*/
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();
        }
    }
}

@@ -520,16 +520,17 @@
 nse.%0A*/%0A
+%0A
 package 
@@ -667,10 +667,11 @@
 lper
+ %7B
 %0A
-%7B
 %0A   
@@ -738,16 +738,17 @@
 stance;%0A
+%0A
     priv
@@ -769,20 +769,16 @@
 Helper()
-%0A   
  %7B%0A     
@@ -791,21 +791,8 @@
  = %22
-jdbc:mysql://
 loca
@@ -812,52 +812,16 @@
 db%22;
- // REPLACE with URL to RDS instance
 %0A    %7D%0A%0A
     
@@ -816,16 +816,17 @@
 %0A    %7D%0A%0A
+%0A
     publ
@@ -1131,91 +1131,111 @@
 root
-%22); //REPLACE with user name and password to RDS instance%0A        %7D%0A        catch (
+1234%22);%0A        %7D catch (SQLException %7C ClassNotFoundException %7C InstantiationException %7C IllegalAccess
 Exce
@@ -1364,20 +1364,16 @@
 nection)
-%0A   
  %7B%0A     
@@ -1547,16 +1547,18 @@
       %7D%0A
-
     %7D%0A
+%0A%0A
 %7D%0A

Update ConnectionHelper.java