According to the system description below draw a Data Flow D

According to the system description below, draw a Data Flow Diagram (DFD). As one of our project topic is e-commerce platform, suppose we are developing one with the following functions: Login Validation: A user first inputs a username and password to the system for validation. The system will retrieve the username from the list of user names and associated passwords. If either the input username or password is wrong, the system will return a message to the user and stay at the login interface. If successfully logging in, the user can choose one of the following actions. Search Items: With the username, the user can search for an item by inputting the item name. After retrieving the list of items, the system will show several alternative items for the user to choose. Once the final item is chosen, it will be stored in the user\'s shopping cart. Pay Items: Another option after login is to directly pay all the items in the shopping cart. The user will provide his/her e-banking account information. The system will check from the e-banking account database (if invalid, return a message to user), retrieve the items information from the shopping cart, and print a receipt on screen to the user. Also, the items to pay will be stored in the user\'s buying history.

Solution

package beans;

public class BookBean
{
   private String bookid;
   private String bookname;
   private String authorname;
   private String status;
  
   public void setBookId(String bookid)
   {
       this.bookid = bookid;
   }
   public String getBookId()
   {
       return bookid;
   }
   public void setBookName(String bookname)
   {
       this.bookname = bookname;
   }
   public String getBookName()
   {
       return bookname;
   }
   public void setAuthorName(String authorname)
   {
       this.authorname = authorname;
   }
   public String getAuthorName()
   {
       return authorname;
   }
   public void setStatus(String status)
   {
       this.status = status;
   }
   public String getStatus()
   {
       return status;
   }
} // BookBean class.

//DBCONNECTION

package beans;

import java.io.*;
import java.sql.*;
import java.util.ArrayList;

public class DbConnector
{
   private int found=0;

   public Connection getConnection()
   {
       Connection con = null;
       try
       {
           Class.forName(\"oracle.jdbc.driver.OracleDriver\");
           con = DriverManager.getConnection(\"jdbc:oracle:thin:@localhost:1521:XE\",\"scott\",\"tiger\");
       }
       catch(Exception e)
       {
           e.printStackTrace();
       }
       return con;
   }

   public ArrayList search(String category)
   {
       Connection con = getConnection();
       PreparedStatement ps = null;
       ResultSet rs = null;
       ArrayList al = new ArrayList();

       try
       {
           String searchQuery;
           searchQuery = \"SELECT BOOKID, BOOKNAME, AUTHORNAME, STATUS \" +
                                   \" FROM SELECT_BOOKS WHERE CATEGORY = ? \";
           ps = con.prepareStatement(searchQuery);

           ps.setString(1, category);
           rs = ps.executeQuery();

           while(rs.next())
           {
               BookBean b = new BookBean();
               b.setBookId(rs.getString(1));
               b.setBookName(rs.getString(2));
               b.setAuthorName(rs.getString(3));
               b.setStatus(rs.getString(4));
               al.add(b);
           }
           rs.close();
       }
       catch(Exception e)
       {
       e.printStackTrace();
       }
       finally
       {
           if(ps != null)
           {
               try
               {
                   ps.close();
               }
               catch(Exception e)
               {
                   e.printStackTrace();
               }
           }
           if(con != null)
           {
               try
               {
                   con.close();
               }
               catch(Exception e)
               {
                   e.printStackTrace();
               }
           }
       } // finally
       return al;
   } // search()
} // class

//SELECTION BOOK

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
import beans.DbConnector;

public class SelectedBooks extends HttpServlet
{
   public void doPost(HttpServletRequest req, HttpServletResponse res)
   {
       try
       {
           String cat = req.getParameter(\"category\");
           String checkAction=req.getParameter(\"source\");

           DbConnector dbc = new DbConnector();

           ArrayList al = dbc.search(cat);
           req.setAttribute(\"list\", al);
           req.setAttribute(\"category\", cat);

           String target;
           if(checkAction.equalsIgnoreCase(\"Html\"))
                   target = \"HtmlPrint.jsp\";
           else
                   target = \"ExcelScreen.jsp\";

           RequestDispatcher rd = null;
           rd = req.getRequestDispatcher(target);
           if(rd != null)
               rd.forward(req,res);
       } // try
       catch(Exception e)
       {
           e.printStackTrace();
       }
   } // doPost()
} // class

<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>
<!DOCTYPE web-app
PUBLIC \"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN\"
\"http://java.sun.com/dtd/web-app_2_3.dtd\">

<web-app>
   <welcome-file-list>
       <welcome-file>Search.jsp</welcome-file>
   </welcome-file-list>

   <servlet>
   <servlet-name>search</servlet-name>
   <servlet-class>SelectedBooks</servlet-class>
   </servlet>

   <servlet-mapping>
   <servlet-name>search</servlet-name>
   <url-pattern>/BookSearchServlet</url-pattern>
   </servlet-mapping>
</web-app>

 According to the system description below, draw a Data Flow Diagram (DFD). As one of our project topic is e-commerce platform, suppose we are developing one wi
 According to the system description below, draw a Data Flow Diagram (DFD). As one of our project topic is e-commerce platform, suppose we are developing one wi
 According to the system description below, draw a Data Flow Diagram (DFD). As one of our project topic is e-commerce platform, suppose we are developing one wi
 According to the system description below, draw a Data Flow Diagram (DFD). As one of our project topic is e-commerce platform, suppose we are developing one wi

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site