Advanced Java Project – Product Management System Part – 3

Program 1

<%-- 
    Document   : InsertProduct
    Created on : Nov 6, 2023, 1:22:08 PM
    Author     : admin
--%>

<%@page import="model.Product"%>
<%@page import="dao.ProductDAO"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@include file="header.jsp"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <% 
           for(int i=1;i<=15;i++)
               out.println("<br>");
        %>
          <center>
             <font color="F19A15" size="7">Search Product Page By Id</font>
             <br>
              <form method="post">
                <table border="1">  
                <tr>
                 <th>Enter Product Id:</th>    
                 <td><input type="text" name="txtid"></td>    
                </tr>   
               <tr>
                   <td></td>
                   <td>
                       <input type="submit" value="Search">
                       <input type="reset" value="Reset">
                   </td>
               </tr>
                </table>      
              </form>    
          <% 
              String prodid=null;
              int pid;
              prodid=request.getParameter("txtid");
             if(prodid!=null) 
             {     
              pid=Integer.parseInt(prodid);
              ProductDAO pd=new ProductDAO();
              Product P=null;
              P=pd.searchProduct(pid);
              if(P==null)
                 out.println("<font color=red size=5>Record not found...</font>");
              
              else
              {
               %>
               <table border="1">  
                   <tr>
                       <th>Prod Id</th><th>Prod Name</th><th>Qty</th><th>Amount</th><th>Type</th>
                   </tr>
                  <tr>
                      <td><%=P.getProdid()%></td>
                      <td><%=P.getProdname()%></td>
                      <td><%=P.getProdqty()%></td>
                      <td><%=P.getProdamt()%></td>
                      <td><%=P.getProdqty()%></td>
                  </tr>    
             <%  
              }     
             } 
              
          %>   
          </table>
          </center>
    </body>
</html>

 

courses

TechVidvan Team

TechVidvan Team provides high-quality content & courses on AI, ML, Data Science, Data Engineering, Data Analytics, programming, Python, DSA, Android, Flutter, full stack web dev, MERN, and many latest technology.

Leave a Reply

Your email address will not be published. Required fields are marked *