package wasdev.sample.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class SimpleServlet
 */
@WebServlet("/SimpleServlet")
public class SimpleServlet extends HttpServlet {
    private static final long serialVersionUID = 1L;

    /**
     * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
     */
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/html");
        response.getWriter().print("Hello World!");
    }

}

@@ -53,17 +53,16 @@
 eption;%0A
-%0A
 import j
@@ -269,16 +269,390 @@
 ponse;%0A%0A
+import java.sql.Connection;%0Aimport javax.naming.Context;%0Aimport javax.naming.InitialContext;%0Aimport javax.naming.NamingException;%0Aimport javax.servlet.ServletException;%0Aimport javax.servlet.annotation.WebServlet;%0Aimport javax.servlet.http.HttpServlet;%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport javax.servlet.http.HttpServletResponse;%0Aimport javax.sql.DataSource;%0A
 /**%0A * S
@@ -1070,32 +1070,35 @@
 ption %7B%0A        
+   
 response.setCont
@@ -1120,16 +1120,18 @@
 tml%22);%0A 
+//
        r
@@ -1173,16 +1173,1002 @@
 rld!%22);%0A
+        %0A        Context initContext;%0A%09%09try %7B%0A%09%09%09initContext = new InitialContext();%0A%09%09%09DataSource ds = (DataSource)initContext.lookup(%22jdbc/kim-dashDB for Analytics-7n%22);%0A%09%09%09Connection conn = ds.getConnection();%0A%09%09//%09System.out.println(%22yes%22);%0A%09%09%09 response.getWriter().print(%22DashDB is connected now!%3C/br%3E%22);%0A%09%09    Statement stmt = conn.createStatement();%0A          %0A            stmt.execute(%22DELETE FROM DOGS WHERE dalmatian = 'husky');%0A%09%09    stmt.execute(%22INSERT INTO DOGS VALUES ('meo1', 'husky' )%22);%0A%09%09    stmt.execute(%22INSERT INTO DOGS VALUES ('meo2', 'husky' )%22);%0A            %0A%09%09%09stmt.executeQuery(%22SELECT * FROM DOGS WHERE dalmatian = 'husky'%22);%0A%09%09%09ResultSet rs = stmt.getResultSet();%0A%09%09%09System.out.println(%22yes%22);%0A%09%09%09while(rs.next()) %7B%0A                 response.getWriter().print(rs.getString(1)+%22  %22+rs.getString(2)+%22%3C/br%3E%22);%0A%09%09%09%7D %0A%09%09%09stmt.close();%0A%09%09%09conn.close();%0A%09%09%7D catch (NamingException %7C SQLException e) %7B%0A%09%09%09// TODO Auto-generated catch block%0A%09%09%09e.printStackTrace();%0A%0A
     %7D%0A%0A%7D

Update SimpleServlet.java