Professional Documents
Culture Documents
of
by Hui-
Hui-Chun Lee
Approved by:________________________________
Dr. C.Y. Hsieh
throughout the course of my master program at KSI. His patience and technical talents
I would like to thank Dr. Shi-Kuo Chang, with his guidance I learned how web
With the growth of the Internet, more and more companies are dedicated to e-
business. Supply chain management has been deemed as one of the useful tools for
businesses to promote their competitiveness, and to build up their trust relationship with
up and down stream businesses. In order to link the whole value chain, information
This study adopts a database-oriented approach and uses a server side program,
Java Servlets, to manage a web-based inventory management system. The idea is to make
information readily and easily available to people who are interested in the data. Once a
company integrates the all-internal systems, it can further combine its up and down
stream businesses.
(CRM) systems to win competitive advantage. Usually, it may take couple of years to
build an integrated ERP system and E-SCM system. Information technology provides a
Chapter 1 Introduction 1
1-2 Objective. 2
3-1 Introduction. 9
3-2 IT Standardization.. 11
4-1 Introduction.... 15
iii
TABLE OF CONTENTS
(Continued)
Chapter 6 Implementation.. 22
Chapter 7 Conclusions.. 39
References.. 41
iv
LIST OF FIGURES
v
CHAPTER 1 INTRODUCTION
E-commerce has been booming for a while. More and more businesses are
dedicated to World Wide Web business. However, a well designed website is not enough.
Competition is more intense in the E-commerce age. Supply chain management (SCM),
customer relationship management (CRM), and enterprise resource planning (ERP) are
important issues in this new age. And the true power of E-commerce rests in the strategy
of the so-called electronic supply chain. The relationship between a company and its
supplier has been changed since the processes of supply and demand become electronic.
Strategy alliance in the web base offers a new way to create mutual benefits among the
between companies. This new cooperation model makes E-commerce become more
attractive. With advanced information technology (IT), a company can adopt a suitable
approach to link the chain. In other words, there is no best solution realizable but there is
information collection, and diverse system connections are significant factors in the
whole value chain. How to integrate these systems and communicate with the external
how efficiently a web-based system can perform. This study builds an online shopping
basket as the front office tool and an online inventory management system as a back
office tool. Both can speed the information flow in a supply chain and reduce the chance
of failure resulting from artificial operation. The study uses the technology of Java
Servlets to deal with the server sides work. All related data is stored in a database.
It is hoped that the prototype system can be referred to when companies would
like to build an ERP system before joining a supply chain. Not only would this reduce the
schedule time to join a supply chain but it also would lower the building cost of using
2
CHAPTER 2 SUPPLY CHAIN MANAGEMENT
Supply chain management (SCM) has broad scope that includes suppliers,
information, and cash flows. Material flow includes the movement of goods from a
supplier to a customer. Information flow involves transmitting orders and updating the
delivery reports. Cash flow consists of credit terms and payment schedules. According to
In simple terms, SCM refers to the methods, systems, and leadership that
For a single product, the raw material is procured from suppliers, transformed into
finished goods from manufacturers in a single step, and then transported to retailers and
3
Figure 2-1 The Early Stage of SCM
organizations. These organizations have their own objectives and these are often
conflicting. The difficulty of these factors is that there is not a single, integrated plan for
the organization; however, there are as many plans as businesses. Clearly, there is a need
for a mechanism through which these different functions can be integrated together. SCM
With the quick development of E-commerce, SCM can be made more effective
through electronic means. For instance, through the website each member in the chain
can access the shared database. Suppliers and manufacturers can quickly and accurately
outsource important functions. According to David Cahn, The need for communication
accuracy, optimize production scheduling, reduce inventory and transportation costs, and
distributing products throughout the value chain. Supply chain execution applications are
designed to manage the flow of products through distribution centers and warehouses and
help ensure that products are delivered to the right location using the best transportation
alternatives available. Supply chain planning can help make better operating decisions.
optimizes delivery of goods, services and information from the supplier to the customer
in an organized and efficient way. For efficient chain management, E-SCM involves
many processes and procedures, such as procurement, outsourcing, and forecasting etc.
5
2-4 Execution in E-SCM
Good planning and lower inventory levels are not enough for business activities.
Supply chain execution can increase a firms competitiveness in the market. Supply chain
The order planning processes involve order entry and processing, order confirmation, and
aggregating inventory plan, capacity planning, and sourcing. The distribution processes
involve distribution scheduling, pick and load, scheduling home delivery, and customer
service.
6
The figure 2-2 is an example of an integration model of E-SCM. [12]
E-SCM uses e-business concepts and web technologies to manage beyond the
standard, business partners can create seamless, automated supply chain systems that
strategic approach that unites all steps in the business cycle, from initial product design
7
and the procurement of raw materials, through production, shipping, distribution, and
In the chain, organizations must work together to help each other succeed. Each
node in the supply chain is a strategic link. Strong links make strong supply chains; weak
links hurt every member in the chain. Today, companies are instructed to construct ever
more efficient and responsive supply chains because it will no longer be company
competing with company, but supply chain competing against supply chain. [3]
Collect information on each product from production to delivery or purchase point, and
Analyze, plan activities, and make trade-offs based on information from the entire
8
CHAPTER 3 INFORMATION TECHNOLOGY FOR SCM
3-1 Introduction
management. IT brings people and information together. With the progress of networking
through the World Wide Web, people can easily access the abundance of data from
The primary goal of IT in the supply chain is to link the point of production with
the point of delivery or purchase. The idea is to have an information trail that follows the
products physical trail. This allows planning, tracking, and estimating lead times based
on real data. Any party that has an interest in the whereabouts of the products should be
addition to tracking products across the supply chain, the system also needs to alert
diverse systems to the implications of this movement. For instance, if the delay happens
in delivery, the appropriate systems need to be notified so the organization can make the
proper adjustments by either delaying the schedules or seeking alternative sources. One
10
3-2 IT Standardization
There are several reasons for the necessity of IT standardization. First of all, in
order to reduce the cost of system maintenance the members in the chain need standards.
Secondly, the supply chain needs a standard to connect different systems and work across
networks. Thirdly, standards can reduce the price of system components, development,
One of the early data exchange standards is electronic data interchange (EDI).
Many larger companies want to simplify their supply chain by using networks to deliver
the information to their trading partners. EDI provides a simple way to allow for
Internet and its standards (HTML, VRML, XML, etc.), today large corporations are
object computing and architectures are emerging, as in CORBA from the Object
databases, and system architecture. Currently the most commonly used devices are
personal computers, Internet devices, bar-codes scanners, and personal digital assistants
(PDAs). In addition there are two standards competing with each other in the market. One
is the Windows interface on Intel-based computers and the other is the web browser with
11
Java standards. There are two major trends in communications. The first is wireless
Regarding databases, there are six types of database in the current market. These
are the legacy database, relational database, object database, data warehouse, data marts,
Two major system architectures are legacy system and client/server system.
Client/server systems are generally more powerful than legacy systems. The
servers. In a client/server system data upgrades can be done entirely at the server side and
it is also easier to add new modules and functions. Application components can be spread
across multiple servers, allowing for better scalability. Access to external resources, such
12
Figure 3-2 Client/Server System Architecture
integration, one application at a time. However, this cannot meet the demands of the
integration (EAI) system provides the integration function from security management,
protocol management, data mapping, and other related functions. EAI solutions can
operations. This control improves interactions with partners and customers, increases
13
Based on the Professor Marvin Manheim in Northwestern University, The
opportunities for competitive advantage in the supply chain. While true this is not the
whole story without a proper integration of technology and people, much time and capital
can be wasted. [14] Computer program cannot replace the human judgment. Therefore
In general, the first step for integration is to organize a project team. The team
manager should establish a time-line for integration the system. The team members
should work together to choose a proper technology and approach. After establishing the
system, the follow-up step is training and testing. The final step is to evaluate the
performance by data entry, the stock of inventory, profit margin, and customer
satisfaction.
14
CHAPTER 4 INTRODUCTION TO ENTERPRISE
4-1 Introduction
Enterprise resource planning (ERP) is a set of applications that serve as the nerve
center of the organization. The whole system is just like a warehouse that stores and
tracks internal information such as inventory levels, pricing structures and other key
system. The system serves all the different departments' particular needs. For instance,
when one department finishes with an order, it is automatically routed via the ERP
system to the next department. To find out where the order is at any point, one needs only
log into the system and track it down. ERP also can apply to the other major business
the system correctly. It can help businesses with product planning, managing inventories,
and interacting with suppliers. Moreover, with ERP in place the company is prepared for
the vital upstream and downstream linkage of systems that enable network planning and
execution. According to the survey by Cisco Systems Inc., Today, more than 60 percent
of Fortune 1000 companies have implemented core ERP applications. Many smaller
15
companies, with revenues less than $250 million, have also installed ERP systems. [2]
ERP system first, so that the data will be accessible and complete.
Business processes may need to change, and employees will need time to become
familiar with and efficient in using the new system. In addition to budgeting for
software costs, financial executives should plan to write checks to cover consulting,
process rework, integration testing and a long laundry list of other expenses before the
Every ERP deployment is different. The application modules are customized. The
architecture of the system and distribution of computing resources are also unique.
performs on the network. Testing the network in advance, understanding how these
applications will perform, and recognizing what impacts they will have on existing
applications are all the key factors to consider. The location of computing resources may
environments. It is important to understand the traffic flows between the client and the
ERP applications can help an organization improve efficiency, reduce costs, and
16
implementation will be a success. Once companies achieve this level of internal
integration with ERP data and supply-chain planning, they can start extending their reach,
sharing information around anticipated demand with customers and suppliers. [7]
Currently, there are two commonly used approaches to ERP systems. One is to
purchase an ERP package from one vendor. The other, called best-of-breed solution,
purchases the appropriate solution in each category from different vendors. The latter is
The major ERP vendors are Baan, J.D. Edwards, Oracle, PeopleSoft, SAP, and
others. ERP integration middleware vendors can be divided to two groups: data-oriented
vendors and messaging-oriented vendors. The data-oriented vendors need data files or
databases to transform data. Instead of using databases or data files, the messaging-
Object Model, JavaBeans, Enterprise JavaBeans, and the Extensible Markup Language as
17
CHAPTER 5 STRATEGIC ALLIANCE
risks, pool strengths, or integrate business functions for mutual benefit. Each of the
partners in an alliance remains a distinct entity, unlike a merger, where the assets are
combined. [10]
company are aware of it, the company is constructing the alliance with suppliers rather
than determining whether it is needed or not, and, if so, what kind of deal is needed.
A good alliance strategy therefore starts at home. The company must not only
define the business logic for its alliances and manage the group of partners well, but it
must also invest resources in the strategy. [17] Firms that are undergoing this are often
cited for their capability. The essence of this capability is that alliances are part of
everyday functioning of the company. They are not special steps relegated to a group of
alliance experts. They are everyones responsibility. At the same time, where special
expertise is needed, the company can find a way to share information and practices
18
5-2 The Elements of Alliance Strategy
There are now plenty of books and reports to describe the keys to success in
strategic alliances. And there is no denying that many alliances stand or fall because of
how they are designed, how the partner is chosen, and other elements specific to the deal
itself. According to the studies, strategic alliance possesses four basic elements in its
foundation.[5]
The supporting system from the internal structure - enhancing the value of external
company, it is essential for a company to think in advance about how alliances fit into the
business strategy and what goals have to be achieved. Supply alliances aim to take
advantage of economies of scale and specialization by having one partner supply the
other with products or services. Positioning alliances help partners enter new markets or
combinations of these goals. It is also crucial to know how the alliance fits into a business
strategy, and it is also important accurately to measure its performance once carried out.
[20]
19
The third element is the method that coordinates all the alliance partners to
increase flexibility. The number of deals in which a company is engaged certainly needs
to be managed. It will probably call for making tradeoffs among partners or even among
goals of different business units. Sometimes engaging in one alliance will foreclose the
option of doing another. This uncertainty is costly to the alliance strategy. Often it is only
after these costs emerge that the need for coordinating the alliance portfolio becomes
clear to all.
infrastructure will also become vital. Tending to alliances will soon begin to place
substantial demands on scarce resources not having the attention of top management.
When the organization is taxed, it will either resist change or find new ways to adjust and
support the alliance strategy. Only the latter can offer a hope of success. In the future, a
company will not survive if they try to do everything themselves, nor will they be saved
by a strategic alliance here or there. But having an alliance strategy implemented through
electronic networking will give them a fighting chance. The new book The International
conceptualizations of strategic alliances and shed light on the alliance system model. [13]
using alliances. As a general matter, alliances themselves are neither good nor bad for a
company. It depends on how they are used and how they are connected in each step.
When managed well, they can create tremendous value; but wrongly used are costly
distractions. The success of an alliance can be simply described in a few words: have a
20
clear strategic purpose, find the right partners, ensure all partners do their part, have a
good vision of the alliance, share information, be flexible, and finally, be prepared. [6]
21
CHAPTER 6 IMPLEMENTATION
There are many different technologies that can be used for building a web-based
system. In this chapter, an online shopping basket and an online inventory management
system will be integrated and new concepts will be applied to the system.
The online shopping basket here is a front office tool that provides online
customers with an informative and well-organized environment for online shopping. The
basket provides a menu function; customers can choose different products by categories.
The shopping basket also provides addition, viewing, and modification functions. After a
customer submits the order, the system will send email to confirm the order and the
22
Figure 6-1 The Initial Web Page of Shopping Basket
Customers can choose the products through the menu on the left side of screen.
24
Customers need to fill out the order form to complete the orders.
The second part of the study is an on line inventory management system. The
traditional inventory management system does not allow checking the inventory status
immediately. Moreover, it takes time to convert the data into useful information and
reports. With this web-based inventory management system, a manager can easily access
and manage the inventory data. First of all, the system allows the authorized user to
check and modify the product data in the database. Addition, modification, deletion, and
The addition function allows the user to add a new category or product to
database. The modification function allows the user to edit the data in the database. The
deletion function allows the user to erase any data in the database. The displaying
25
All product information is stored in a database. There are two entities in the
database. One is the category entity. The other is the product entity. The category entity
stores the detail information about the category such as category id, name,
descriptionetc. The product entity stores the detail information about the product such
as product id, name, price, stock quantityetc. Each entity is related to each other by a
primary key and foreign key in the table. Therefore, one category can have many
The whole system begins with a login web page. After the authorized user logs in
with a correct name and password, then the system will show the main inventory menu
page. In the system a server side program on the web server generates all client side
requests. According to the client side requests the server will send the result to the client.
26
The system flow is as in Figure 6-6.
In the system all the user interfaces are designed by web page. The login page is
the entry page in the system. The system requires the authorized user to log into the
system. After the user logs in with valid name and password, the main menu web page
will show on the screen. The system also allows the user to log out in any working web
page. Whenever the user submits a request, the system will generate the request by the
proper Java Servlet program and send the result to the client side web page.
27
Figure 6-7 The Login Web Page
28
When a user wants to add a new category, one can click the add button then the
Figure 6-9 The Add Category Web Page of Inventory Management System
After the user adds a new category, the system will add the data into the database
and show the result on the web page at the same time.
29
When a user clicks to delete a category, the deletion page will show on the screen.
After the user hits the submit button, the system will show the confirmation page.
30
When a user wants to modify the data, the data can be searched by category id.
After the user hits the search button, the system will show the data on the screen.
31
When a user clicks the view button, the system will display all data in the
database.
After the user clicks the show all button, the system will display all data on the
screen.
Figure 6-17 The Add Product Web Page of Inventory Management System
After the user adds a new product, the system will add the data into database and
In this section, let us take a look at how the program works with some partial code
dissection. First of all, for the shopping basket part, the item addition is generated by a
buyItem function.
After adding an item to the basket, a customer can modify or view the basket. The
function showItems() {
index = document.cookie.indexOf("TheBasket");
countbegin = (document.cookie.indexOf("=", index) + 1);
countend = document.cookie.indexOf(";", index);
if (countend == -1) {
countend = document.cookie.length;
}
fulllist = document.cookie.substring(countbegin, countend);
subtotal = 0;
itemlist = 0;
for (var i = 0; i <= fulllist.length; i++) {
if (fulllist.substring(i,i+1) == '[') {
itemstart = i+1;
thisitem = 1;
}
else if (fulllist.substring(i,i+1) == ']') {
itemend = i;
thequantity = fulllist.substring(itemstart, itemend);
itemtotal = 0;
itemtotal = (eval(theprice*thequantity));
temptotal = itemtotal * 100;
subtotal = subtotal + itemtotal;
itemlist=itemlist+1;
document.write('<option>'+thequantity+' st '+theitem+'</option>');
}
else if (fulllist.substring(i,i+1) == '|') {
if (thisitem==1) theitem = fulllist.substring(itemstart, i);
if (thisitem==2) theprice = fulllist.substring(itemstart, i);
if (thisitem==3) theoption = fulllist.substring(itemstart, i);
thisitem++;
itemstart=i+1;
}
}
35
Secondly, for the inventory management system part, the system begins with a
login web page. The web page will pass two parameters to the Servlets, then the Servlets
will generate the request and send the result back to web page. The HTML code is as
below.
</FORM>
When logging into the main menu web page, a user can access the database. For
instance, to add a category to database, through the web page the user can send the
</FORM>
36
The Servlets code is as below.
To delete a category from the database, through the web page the user can send
the request to Servlets. The HTML page for deleting a category is as below.
</FORM>
In general, HTML interacts with Java Servlets by using the FORM element of
HTML. Inside the FORM tag, HTML can pass the parameters and method attribute to
Servlets. Servlets are Java programs that run on the backend like CGI programs. The
Servlet engine passes two objects to either the doGet() or doPost() method by default.
The HttpServletRequest can be used to get information about the request such as the
names and values of the FORM. HttpServletResponse can be used to generate a response
38
CHAPTER 7 CONCLUSION
This study conveys the conceptual idea of supply chain management. In the real
world, the situation is more complicated. Usually, it may take couple of years to build an
integrated ERP system and E-SCM system. Information technology provides a more
efficient way to build the system. In general, different industries will adopt different
approaches. Therefore, the business cycle time reduction and improved efficiency in
Two additional concepts can be added to improve the system in this study. The
first one is system combination. For an integrated ERP system, the system should include
The second one is the upstream and downstream linking. Currently, this study just
links with customers. In order to connect all the suppliers in the business chain, the
system should have the ability to link the supply chain together in the web environment.
This study was not intended to build up a huge management system, but to
illustrate how an ordering system can be easily connected with an inventory system in
39
enforcing the existing functions, the system can be easily incorporated into a full-featured
40
REFERENCES
[1] Bo-Christer Bjrk (June 2000). A Framework for Measuring IT Innovation Benefits.
http://itcon.org/2000/4/.
[2] Cisco Systems, Inc. (July 2000). Solutions Guide Building an ERP-ready Network.
http://www.erpassist.com/browse.asp?c=ERPPeerPublishing.
[3] Andrew Cox (1999). Power, Value and Supply Chain Management. Supply Chain
Management: An International Journal, Vol 4 pp. 192-198.
[4] Peter Fabris (June 1997). ERP & Extranet Application. CIO Journal. Vol 10 Issue 17
pp. 70-78.
[5] Benjamin Gomes-Casseres. (May 1996). The Alliance Rrevolution: the New Shape of
Business Rivalry. Cambridge, Mass: Harvard University Press. pp. 6-11.
[6] Benjamin Gomes-Casseres (August 1998). Strategy Before Structure. The Alliance
Analyst. http://www.allianceanalyst.com/Article1Aug15-98.html.
[7] Lisa H. Harrington. (April 1997). ERP & Supply Chain. Industry Week. Vol 246
Issue 7 pp. 97-100.
[9] Dan Kara. (March 1999). ERP Integration - vendors race to meet IT's growing need
for integral links to enterprise apps.
http://www.informationweek.com/724/24prerp.htm.
[11] Christopher Koch, Derek Slater and E. Baatz (December 1999). The ABCs of ERP.
http://www.cio.com/research/erp/edit/122299_erp.html.
[12] Petra Lattmann (February 2001). Supply Chain Solutions Focus on Customers
Needs. id SYSTEMS. pp. 30-39.
41
REFERENCES
(Continued)
[14] Marvin Manheim (April 1999). Integrating People and Technology for Supply
Chain Advantage. http://www.ascet.com/documents.asp?d_ID=236.
[16] Deb Navas (February 2001). The Extended Electronic Supply Chain. id SYSTEMS.
pp.18-29.
[17] S. Benjamin Prasad and Richard B. Peterson, eds (1992).Technology Flows and
Global Competition: A Framework for Research and Management. Advances in
International Comparative Management. Vol 7. Greenwich, CT: JAI Press Inc.,
pp. 3-22.
[19] David Simchi-Levi, Philip Kaminsky, Edith Simchi-Levi (2000). Designing and
Managing the Supply Chain. Burr Ridge, IL:The McGraw-Hill Companies, Inc..
pp. 215-247.
[20] David B. Yoffie, ed. (1993). Computers: Alliances and Industry Evolution.
Beyond Free Trade: Firms, Governments, and Global Competition. Boston, MA:
Harvard Business School Press pp. 79-128.
42
APPENDIX A
43
/* Source Code of Login - LoginServlet.java*/
import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
44
/* Source Code of Add Category - AddCategory.java*/
import java.sql.*;
import java.text.*;
import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
//declare variables
static String c_id;
static String name;
static String desURL;
static String des;
static Connection con;
res.setContentType("text/html");
PrintWriter out = res.getWriter();
String menu = req.getParameter("menu");
if(menu!=null){res.sendRedirect("http://localhost:8080/test/inventorymenu.html");}
String logout = req.getParameter("logout");
if(logout!=null){res.sendRedirect("http://localhost:8080/test/login.html");}
out.println("<html>");
out.println("<body>");
out.println("<center>");
out.println("<h1><b>The data you add is as below:</b></h1>");
out.println("<table border=1 bordercolor=black><tr align=middle>");
out.println("<th>ID</th><th>NAME</th><th>DESCRIPTION_URL</th>
<th>DESCRIPTION</th></tr>");
out.println("<th>"+c_id+"</th>"+"<th>"+name+"</th>"+"<th>"+desURL
+ "</th>"+"<th>"+des+"</th></tr>");
45
// Open the database
try{open();} catch(Exception e){};
try{insert(c_id, name, desURL, des);}catch(Exception e){};
try{close();}catch(Exception e){};
out.println("</table>");
out.println("<a href=http://localhost:8080/test/addcategory.html>Back</a>");
out.println("</center></body>");
out.println("</html>");
}
46
/* Source Code of Delete Category - DelCategory.java*/
import java.sql.*;
import java.io.*;
import java.text.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
res.setContentType("text/html");
PrintWriter out = res.getWriter();
cid = req.getParameter("id");
String menu = req.getParameter("menu");
if(menu!=null){res.sendRedirect("http://localhost:8080/test/inventorymenu.html");}
String logout = req.getParameter("logout");
if(logout!=null){res.sendRedirect("http://localhost:8080/test/login.html");}
out.println("<html>");
out.println("<body>");
out.println("<center>");
out.println("<h1><b>The data has been deleted successfully!</b></h1>");
47
// Open a database connection
static void open() throws SQLException{
48
/* Source Code of Modify Category - ModifyCategory.java*/
import java.sql.*;
import java.text.*;
import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
res.setContentType("text/html");
PrintWriter out = res.getWriter();
id = req.getParameter("cid");
String q= " WHERE cid = " + id;
String action = "update";
out.println("<HTML>");
out.println("<TITLE>Modify Category Data</TITLE>");
out.println("<BODY><CENTER>Modify Category Data");
50
stmt.close();
}
51
/* Source Code of Display Category - DisplayCategory.java*/
import java.sql.*;
import java.text.*;
import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
53
/* Source Code of Add Product - AddProduct.java*/
import java.sql.*;
import java.text.*;
import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
res.setContentType("text/html");
PrintWriter out = res.getWriter();
String menu = req.getParameter("menu");
if(menu!=null){res.sendRedirect("http://localhost:8080/test/inventorymenu.html");}
String logout = req.getParameter("logout");
if(logout!=null){res.sendRedirect("http://localhost:8080/test/login.html");}
p_id = req.getParameter("pid");
c_id = req.getParameter("cid");
name = req.getParameter("name");
price = req.getParameter("price");
stockqty = req.getParameter("qty");
dangerlevel = req.getParameter("danger");
supplier = req.getParameter("supplier");
contact = req.getParameter("mail");
desURL = req.getParameter("description_url");
des = req.getParameter("description");
out.println("<html>");
out.println("<body>");
out.println("<center>");
out.println("<h1><b>The data you add is as below:</b></h1>");
out.println("<table border=1 bordercolor=black><tr align=middle>");
out.println("<th>PID</th><th>CID</th><th>NAME</th><th>PRICE</th>
<th>QUANTITY</th>"
54
+"<th>DANGERLEVEL</th><th>SUPPLIER</th><th>CONTACT</th>
<th>DES_URL</th><th>DESCRIPTION</th></tr>");
out.println("<th>"+p_id+"</th>"+"<th>"+c_id+"</th>"+"<th>"+name+"</th>"
+"<th>"+price+"</th>"+"<th>"+stockqty+"</th>"+"<th>"+dangerlevel+"</th>"
+"<th>"+supplier+"</th>"+"<th>"+contact+"</th>"+"<th>"+desURL+"</th>"
+"<th>"+des+"</th></tr>");
try{close();}catch(Exception e){};
out.println("</table>");
out.println("<a
href=http://localhost:8080/test/addproduct.html>Back</a>");
out.println("</center></body>");
out.println("</html>");
}
55
// A SQL query for inserting data from database
static void insert(String pid, String cid, String name, String price, String qty,
String dlevel, String supplier, String contact, String desURL, String des)
throws SQLException{
Statement stmt;
String query = "insert into product values(" + "'" + pid +"','"+ cid +"','"+ name +"','"
+ price + "','" + qty + "','" + dlevel + "','" + supplier + "','" + contact + "','" + desURL
+ "','" + des + "')";
stmt = con.createStatement();
stmt.executeUpdate(query);
}
}
56
/* Source Code of Delete Product - DelProduct.java*/
import java.sql.*;
import java.io.*;
import java.text.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
try{delete();}catch(Exception e){};
try{close();}catch(Exception e){};
out.println("</table>");
out.println("<a href=http://localhost:8080/test/delcategory.html>Back</a>");
out.println("</center></body>");
out.println("</html>");
}
57
// Open a database connection
static void open() throws SQLException{
58
/* Source Code of Modify Product - ModifyProduct.java*/
import java.sql.*;
import java.text.*;
import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
res.setContentType("text/html");
PrintWriter out = res.getWriter();
id = req.getParameter("pid");
String q= " WHERE pid = " + id;
String action = "update";
out.println("<HTML>");
out.println("<TITLE>Modify Product Data</TITLE>");
out.println("<BODY><CENTER>Modify Product Data");
query = query = "SELECT pid, cid, pname, desurl, price, stockqty, dangerlevel,
description, supplier, contact_mail" + " FROM product " + whereClause;
stmt = con.createStatement();
rs = stmt.executeQuery(query);
more = rs.next();
if(!more){
System.out.println("No rows found.");
return;
}
60
rs.close();
stmt.close();
}
61
/* Source Code of Display Product - DisplayProduct.java*/
import java.sql.*;
import java.text.*;
import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
62
// ODBC data source name
String dsn = "jdbc:odbc:SCMDB";
String user = "";
String password = "";
63
}
rs.close();
stmt.close();
}
}
64
/* Source Code of Logout - LogoutServlet.java*/
import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
65
APPENDIX B
KSI Inventory Management System
implement a real world case. The system runs on KSI (Knowledge Systems Institute)
password-protected system that can be accessed only by users who have sufficient
privileges. It begins with an entry page, booklogin.html. When logging into the main
menu web page, a user can access the database. The system provides four functions to
File Description
Table Appendix.1 The File List of KSI Web-Based Inventory Management System
67
Figure 2 The Entry Page of KSI Inventory Management System
68
Figure 4 The Adding Data Page of KSI Inventory Management System
Figure 5 The Confirmation Page of Adding Data in KSI Inventory Management System
69
Figure 6 The Deleting Data Page of KSI Inventory Management System
Figure 7 The Confirmation Page of Deleting Data in KSI Inventory Management System
70
Figure 8 The Searching Data Page of KSI Inventory Management System
71
Figure 10 The Showing Data Page of KSI Inventory Management System
Figure 11 The Displaying All Data Page of KSI Inventory Management System
72
Figure 12 The Log Out Page of KSI Inventory Management System
73