//package servlet;
//
//import javax.annotation.Resource;
//import javax.servlet.ServletException;
//import javax.servlet.annotation.WebServlet;
//import javax.servlet.http.HttpServlet;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import javax.sql.DataSource;
//import java.io.IOException;
//import java.sql.Connection;
//import java.sql.PreparedStatement;
//import java.sql.ResultSet;
//import java.sql.SQLException;
//
///**
// * @author : ShEnUx
// * @time : 1:57 PM
// * @date : 12/23/2022
// * @since : 0.1.0
// **/
//
//@WebServlet(urlPatterns = "/customer")
//public class MyServlet extends HttpServlet {
//    @Resource(name = "java:comp/env/jdbc/pool")
//    DataSource dataSource;
//    @Override
//    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//        System.out.println("Reuest received");
//        try {
//            Connection connection = dataSource.getConnection();
//            PreparedStatement pstm = connection.prepareStatement("select * from Customer");
//            ResultSet rst = pstm.executeQuery();
//            while (rst.next()) {
//                String id = rst.getString("id");
//                System.out.println(id);
//            }
//
//        } catch (SQLException e) {
//            throw new RuntimeException(e);
//        }
//    }
//}
