package cs3220.servlet; import java.io.IOException; import java.io.PrintWriter; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import javax.servlet.ServletConfig; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet("/HelloJDBC") public class HelloJDBC extends HttpServlet { private static final long serialVersionUID = 1L; public HelloJDBC() { super(); } public void init( ServletConfig config ) throws ServletException { super.init( config ); try { Class.forName( "com.mysql.cj.jdbc.Driver" ); } catch( ClassNotFoundException e ) { throw new ServletException( e ); } } protected void doGet( HttpServletRequest request, HttpServletResponse response ) throws ServletException, IOException { PrintWriter out = response.getWriter(); out.println( "" ); out.println( "