title: AWS Lambda Java, connect to MySQL RDS
body: <p>I need to develop an AWS Lambda Java function to retrieve some records from RDS MySQL database.</p>
  
  <p>Should I use JDBC? Should I use the standard JDBC example: </p>
  
  <pre class="lang-java prettyprint-override"><code>try {
      String url = "jdbc:msql://200.210.220.1:1114/Demo";
      Connection conn = DriverManager.getConnection(url,"","");
      Statement stmt = conn.createStatement();
      ResultSet rs;
  
      rs = stmt.executeQuery("SELECT Lname FROM Customers WHERE Snum = 2001");
      while ( rs.next() ) {
          String lastName = rs.getString("Lname");
          System.out.println(lastName);
      }
      conn.close();
  } catch (Exception e) {
      System.err.println("Got an exception! ");
      System.err.println(e.getMessage());
  }
  </code></pre>