Shankar Final
Shankar Final
By
M.SANKARA NARYANAN
A PROJECT REPORT
Submitted to the
of
February, 2010
ii
BONAFIDE CERTIFICATE
who carried out the work under my supervision. Certified further that to the best of my
knowledge the work reported herein does not form part of any other project report or
Signature of Project-in-charge
Name:
Designation:
.
iii
iv
Certificate of Viva-voce-Examination
Chennai- 25.
Name: Name:
Designation: Designation:
Address: Address:
Coordinator
Study Centre
Name:
Designation:
Address: Anna University,
Chennai 600025
Date:
v
RUf;fk;
ABSTRACT
Tool provides an end to end solution, to maintain optimum inventory level and deliver
high customer service. It involves modern inventory management processes and more
refined techniques that provide dynamic optimization of inventories to maximize
customer service with decreased inventory and lower costs.
The application has two views, corporate and store. Corporate login performs certain
actions which are user registration, product categorization, vendor management, store
management and item master. Store login actions are inventory upload, scrap entry,
billing and reports.
There are four modules which are as follows; User, Product Catalog, Billing and
Reports. Corporate team registers the store user and deal with vendors for sourcing and
procurement activities. Once core vendors are identified they will be linked into items.
They fix up maximum threshold inventory level for all the items to control surplus
stock level. Store users update the inventory details in the system for respective store
code. To ensure on-time replenishment they run cycle count report on daily basis.
The Project is developed using JAVA Struts as front-end and MYSQL as back end.
vii
ACKNOWLEDGEMENT
The satisfaction that accompanies the successful completion of any task would
be incomplete without mentioning the names of people who made it possible, whose
Anna University for his invaluable guidance, support and suggestions throughout the
TABLE OF CONTENTS
LIST OF TABLES 2
LIST OF FIGURES2 2
LIST OF SYMBOLS3 3
1. INTRODUCTION 4
1.2.LITERATURE SURVEY 5
1.3.PROPOSED SYSTEM 6
1.5.ORGANIZATION OF THESIS
2. SYSTEM REQUIREMENTS SPECIFICATION 7
2.1.HARDWARE REUIREMENTS 7
2.2.SOFTWARE REUIREMENTS 7
3. REQUIREMENT SPECIFICATION 8
3.1.JAVA 8
3.3. MVC 18
3.4.JAVA SCRIPT 25
3.5.MYSQL 27
3.6.JDBC 33
3.7.TOMCAT 35
3.8.EASYECLIPSE 37
4.1.OVERBIEW 38
4.2.MVC ARCHITECTURE 38
4.3.SYSTEM DESIGN 40
x
USECASE DIAGRAM 41
TABLE DESIGN 42
5. SYSTEM IMPLEMTATION 44
5.1.FUNCTIONAL DESCRIPTION 44
5.2.USER INTERFACE 45
6. TESTING 46
6.1.UNIT TESTING 46
6.2.INTEGRATION TESTING 46
6.3.SYSTEM TESTING 47
6.4.TEST CASES 47
7. CONCLUSION 48
APPENDICES 49
REFERENCES 54
1
LIST OF FIGURES
LIST OF TABLES
LIST OF ABBREVIATIONS
S. No Acronyms Comments
1 RFID Radio Frequency Identification Device
2 MVC Media View Controller
3 JSP Java Servlet Page
4 URL Uniform resource locator
3
CHAPTER 1
INTRODUCTION
Online Inventory is a web based tool, which helps to optimize the inventory level and enhance
high customer service and facilitate the management to make strategic decisions that drives the
business in an efficient manner. The application being modeled is that of a small-to-medium
Retailer offering multiple products to Consumers; a typical B2C model. To fulfill orders, the
Retailer has to manage stock levels in warehouses. When an item in stock falls below a certain
threshold, the Retailer must replenish the item from the relevant Manufacturer’s inventory (a
typical B2B model). This tool helps to manage their inventory level in more effective approach.
The Original scope of the project was to improve upon the bottom line of Inventory Control
process by developing Online Inventory management tool. However the course of the project has
changed to focus more on the implementation of Modern inventory management processes. The
refinement procedures were being developed when it was discovered that it was not clear how to
define the refinement amount. In other words, a refinement dimension was unable to be
determined. Although this portion of the project was unable to move forward, it has not been
forgotten. The new focus of the project is developing tool which provides for dynamic
optimization of inventories to maximize customer service with decreased inventory and lower
costs.
replenishment One of the fundamental tradeoffs in supply chain management is that between
inventory levels and customer service. For any given supply chain, increasing the level of service
(product/spare part availability) typically means higher levels of inventory. Most companies have
discovered their "best place" on the curve, depending on what their customers require and what
their competition offers. However, supply chain strategies can shift the entire curve, lowering your
inventory levels without adversely affecting your customers (or the reverse, improving customer
service levels with no increase in inventory).
Inventory control is concerned with minimizing the total cost of inventory. The three main factors
in inventory control decision making process are:
The cost of holding the stock (e.g., based on the interest rate).
The cost of placing an order (e.g., for row material stocks) or the set-up cost of production.
The cost of shortage, i.e., what is lost if the stock is insufficient to meet all demand.
The third element is the most difficult to measure and is often handled by establishing a "service
level" policy, e. g, certain percentage of demand will be met from stock without delay. The ABC
Classification system is to grouping items according to annual sales volume, in an attempt to
identify the small number of items that will account for most of the sales volume and that are the
most important ones to control for effective inventory management.
Reorder Point: The inventory level R in which an order is placed where R = D.L, D = demand
rate (demand rate period (day, week, etc), and L = lead time.
Safety Stock: Remaining inventory between the times that an order is placed and when new stock
is received. If there are not enough inventories then a shortage may occur.
Safety stock is a hedge against running out of inventory. It is an extra inventory to take care on
unexpected events. It is often called buffer stock. The absence of inventory is called a shortage.
5
Inventory control requires the tracking of all parts and materials purchased, products processed,
and products stored and ready for shipment. From a financial perspective, inventory is the largest
asset item on a manufacturer’s or distributor’s balance sheet. Inventory Control is vital to
maximize your profitability. Inventory control software should "control" your inventory. If it
doesn't do this effectively, it is merely inventory "correction" software. Inventory control knows
what to order, when to order, how much to order so that you can determine and maintain
optimum stock levels. Everything else in the inventory control process simply supports this goal.
The Online Inventory control tool is designed to run on the retail stores, which involves modern
inventory control techniques. This tool will be web based Inventory control software. That can be
installed on your web server and runs in your web browser just like a typical web site.
We can get the details about System requirements about this project in Chapter 2. We can get the
overview of Online Inventory in Chapter 3. The Chapter 4 will give the design aspects of Online
Inventory. The Chapter 5 discusses about the Implementation of the Design. Chapter 6 discusses
the Testing Details and Chapter 7 deals with the Conclusions and Future Enhancements.
6
CHAPTER 2
CHAPTER 3
REQUIREMENT SPECIFICATION
The Java platform is based on the concept “Write Once Run Anywhere”. The idea is that same
software should run on different kinds of computers, gadgets, and other devices. The java platform
is being built into next generation consumer and business devices like telephones, smart cards etc.
Java is a programming language popularly used to build programs that can work on the internet. Its
primary features also include being Object Oriented Programming in addition to being a cross
platform language. By cross platform we mean that its programs can run across several programs
can run across several platforms such as Microsoft Windows, Apple Macintosh, Linux etc.,
Java is not only used for standalone applications or net based programs but also to program
consumer devices and accessories such as cellular phones, palm pilots and other gadgets.
The key considerations were summed up by the java team in the following list of Buzzwords:
Simple
Secure
Portable
Object-oriented
Robust
Multi-threaded
Architectural- neutral
8
Interpreted
High performance
Distributed
Dynamic
Simple:
Java was designed to be easy for the professional programmer to learn and use effectively. If one is
an experienced in C++ programming, learning java will be easier. Because java inherits the C/C++
syntax and many of the object oriented features of C++.
Object oriented:
Java is a true object oriented language. Almost everything in java is an object. All java code reside
and date reside within objects and classes. Java comes with extensive of set of classes, arranged
packages that we can use in our programs by inheritance. The object model in java is simple and
easy to extend.
Robust:
Java provides many safe guards to ensure reliable code. It has strict compile time and runtime
checking for data types. Java also incorporates the concept of exception handling which captures
series errors and eliminates any risk of crashing system.
It rectifies the main two problems of program failure:
Memory management mistakes
Mishandled Exception conditions
Platform Independence:
The most significant contribution of java over other languages is its platform independence.
Changes and upgrades in operating Systems, Processor, and System resources will not force any
changes in java programs.
9
With java no longer to develop separate applications for different programs such as DOS, windows
UNIX, Linux, Solaris, Macintosh etc., An application developed in java is usable on multiple
platforms. This is the reason why java has become popular language form programming on
internet which interconnects different kinds of systems worldwide.
Distributed:
Java is designed for the distributed environment of the internet, because it handles TCP/IP
protocols. In fact, accessing resources using a url is not mu4ch different from accessing a file. Java
also supports “Remote Method Invocation”. This feature enables a program to invoke methods
across a network.
Dynamic:
Java programs carry with them substantial amounts of runtime type information that is used to
verify and resolve accesses to objects at run time. This makes it possible to dynamically link code
in safe and experienced manner. This is crucial to the robustness to the applet environment in
which small fragments of byte code may be dynamically of byte code may be dynamically updated
on a running system.
Multi-threaded:
Java was designed to meet the real world problems of creating interactive, networked programs.
To accomplish them java supports multi threaded which allows you to write programs that do
many things simultaneously. The java runtime system comes with an elegant yet sophisticated
10
solution for multiprocessor synchronization that enables you to construct smoothly running
interactive systems.
Java expanded the universe of object that can move about freely in cyberspace. In a network, two
very broad categories of object are transmitted between the server and client.
Passive Information
Dynamic Programming
As desirable as dynamic, networked programs are, they also present serious problems in areas of
security and portability. So java provides the following facilities:
Java Applets
Security
Portability
Java Applet:
An Applet is an special type of program that is designed to be transmitted over the internet and
automatically executed by a java compatible web Browser. An applet is downloaded on the
demand, like an image, audio File, video file. Important difference is that an applet is an
“Intelligent program”. It is a program that can react to user input and dynamically change not jest
run the same animation or sound over and over.
Portability:
Many types of computers and operating systems connected to the internet throughout the world.
For programs to be dynamically downloaded to the all various types of platforms connected to the
internet, some means of generating portable executing code is needed.
11
Security:
When we use java compatible web browser, you can safely download java applets without fear of
vital infection or malicious intent. Java achieves this protection by configuring a java program to
the java execution environment and not allowing it access to other parts of the computer.
Java Server Page (JSP) is a template for a web page that uses Java code to generate an HTML
document dynamically. JSP are run in a server side component known as “JSP Container” , which
translates them into equivalent java servlets. For this reason servlets and jsp are related.
3.2.1 Benefits:
JSP has all the advantages of servlets. But in addition, JSP pages have advantages of their own.
3.2.2Advantages :
The Java Server Pages technology emphasizes the use of reusable components such as: Java
Beans components, Enterprise Java Beans components and tag libraries. These components can be
used in interactive tools for component development and page composition. This saves
considerable development time while giving the cross-platform power and flexibility of the Java
programming language and other scripting languages.
12
The Java Server Pages technology enables the separation of static content from dynamic content
that is inserted into the static template. This greatly simplifies the creation of content. This
separation is supported by beans specifically designed for the interaction with server-side objects,
and, specially, by the tag extension mechanism.
The Java Server Pages technology supports scripting elements as well as actions. Actions permit
the encapsulation of useful functionality in a convenient form that can also be manipulated by
tools; scripts provide a mechanism to glue together this functionality in a per-page manner.
The Java Server Pages technology is an integral part of the Java 2 Platform Enterprise Edition
(J2EE), which brings Java technology to enterprise computing. You can now develop powerful
middle-tier server applications, using a Web site that uses Java Server Pages technology as a front
end to Enterprise JavaBeans components in a J2EE compliant environment.
The URL by which it is known to the network is the same; expect it is file name ends in .jsp
instead of .html.
Next, when jsp source file URL is invoked for the first time, jsp container reads the jsp source file,
parses its content , and generates the source code for an equivalent java servlet. It then compiles
the servlet and creates a compiled java file
Finally, the JSP Container loads the servlet class and uses it to service the HTTP request. The
middle step is repeated for later requests only if the jsp source file has been modified.
A jsp source file can contains jsp elements, fixed template date, or any combinations of the two
elements are instructions to the JSP container about what code to generate and how it should
operate. These elements have specific start and end tags that identified them to the jsp compiler.
o Directives
o Scripting Elements
o Actions
1. Directives :
These are instructions to the JSP container that describe what code should be generated. JSP
describes three standard directives available in all complaint JSP environments.
o Page
o Include
o Taglib
14
Page directive is used to specify attributes for the JSP Page as a whole. Include directive
merges the content of another file at translation time into the jsp source file input stream. Taglib
directives make custom actions available in the current page through the use of a tag library.
2. Scripting Elements :
Expressions :
JSP provides a simple means for accessing the value of a java variable orother expression and
merging that value with the HTML in the page.
Scriplets :
Scriplet is a set of one or more java language statements intened to be used to process an HTTP
request.
Declarations :
It can be used to declare class or instance variables, methods, or inner classes. Unlike scriplets,
they have no access to the implicit objects. To declare a method that needs to use the request
objects.
3. Actions :
Standard Actions are high level JSP elements that create modify or use other objects. Unlike
directives and scripting elements, actions are coded using strict XML syntax.
The Web Server does not remember clients from from one request to the next, the only way to
maintain in a session is for clients to keep track of it. Four Techniques to achieve this task. They
are :
Hidden Fields
URL Rewriting
HTTP Session API
Cookies
Hidden Fields :
HTML forms support input elements with type of Hidden. These fields are passed along with other
form parameters in the HTTP request sent to the web server, but they do not have any visual
representation. They are more useful in dynamically generated web pages created by server
processes.
The problem with hidden fields is that they can only be used in html forms . If the user clicks a
hyperlink and leaves the pages, the hidden fields are lost.
URL Rewriting :
A URL can have parameters appended to it that are sent along with the request to the web server.
These Parameters are Name – Value Pairs. This technique is guaranteed to work in all browser
environments and security settings but that is about its only advantage.
It tends degrade performance if large amounts of data are stored. The URLs can become very
large, possibly exceeding the size accepted by the web server. Additionally, the URLs are not
secure, being visible in the browser address window and in web server logs.
16
Cookies:
The most widely used technique for persistent client data storage involves HTTP cookies. a
cookies is small ,named data elements the server passes to a client with a set-cookie header as part
of the HTTP response. Along with name and value, cookie may contain :
An Expiration Date
A Domain Name
A Secure Attribute
A Path name that further restricts the URL Subset.
Cookies over other persistence schemes is that they can retain their values after the browser
session is over , even after the client computer is rebooted.
A Session is created by a call to the method getSession() and persists until it times out or is shut
down by a servlet participating in the session. Incoming HTTP requests that carry the session
identifier are automatically associated with the session. There are seven classes available for
session.
Sessions are shared between all servlets and JSP pages in the current HTTP session. Any
kind of object can be stored in a session, but because sessions may be serialized. A point is that
only objects can be stored but not primitive types like int, float, and others. The link between
client and web server is a logical session, not a persistent connection.
A tag extension is a java class . Its Java bean which implements one of two interfaces. The JSP
specification states, that takes have a richer runtime protocol than Java Beans. There are some
reasons :
17
Initialization can involve properties, without which the tag will not run
Setting and getting properties does not cover all bases there is kittle control
logic available within the bean.
dBeans are not aware by default of there context in the jsp page as they need
to be, there is no default concept of a parent.
Simplicity :
It is significantly easier to express a complex task as a corresponding set of subtask with their own
attributes and control flow then it is to right it as a mono lit hick of code.
Tag Libraries:
Custom tags are implemented and distributed in a structure known as a Tag library, also referred to
as a tag lib. A tag library is a collection of classes and meta information that includes :
Tag Handlers
Tag Extra Information Classes
A Tag Library Validator
A Tag Library Descriptor
The components of a tag library can be installed any where they are accessible to the JSP
Container.
18
An web application based on the three logical areas of the higher level architecture. They are :
Presentation Layer :
The front end which controls the look and feel and delivers the result. It can be thought of as user
interface for the application because it is used to get input from the end user interface the
application. This refers to how you see the component on the screen
Model Logic :
The model encompasses the state of the each component. There are different models for different
types of components. This information remains the same no matter how the component is painted
on the screen. Model data always exist independent of the component visual representation.
Controller Layer:
It is the portion of the user interface that indicates that how component interacts with events.
Events come in many formats a mouse click, gaining or losing focus. It decides how each
component will react to the event if it reacts at all.
The early JSP specifications presented two approaches for building web applications using JSP
technology. These two approaches were the JSP Model 1 and Model 2 architectures. Although
these terms are no longer used in the JSP specification, they still are widely used throughout the
web tier development community.
The two JSP architectures differ in several key areas. The major difference is in how and by which
component the processing of a request is handled. With the Model 1 architecture, the JSP page
handles all of the processing of the request and is responsible for displaying the output to the
client. This is illustrated in below figure
19
Notice that there is no extra servlet involved in the process. The client request is sent directly to a
JSP page, which may communicate with JavaBeans or other services, but ultimately the JSP page
selects the next page for the client. The next view is determined based on either the JSP selected or
parameters within the client's request.
In contrast, in the Model 2 architecture, the client request is first intercepted by a servlet, referred
to as a controller servlet. This servlet handles the initial processing of the request and determines
which JSP page to display next. This approach is illustrated in below figure.
20
As shown in the figure, a client never sends a request directly to a JSP page in the Model 2
architecture. This allows the servlet to perform front-end processing, including authentication and
authorization, centralized logging, and help with internationalization. Once request processing has
completed, the servlet directs the request to the appropriate JSP page. How the next page is
determined varies widely across different applications. For example, in simpler applications, the
next JSP page to display may be hardcoded in the servlet based on the request, parameters, and
current application state. In more sophisticated web applications, a workflow/rules engine might be
used.
As you can see, the main difference between the two approaches is that the Model 2 architecture
introduces a controller servlet that provides a single point of entry and encourages more reuse and
extensibility than the Model 1 approach. With the Model 2 architecture, there is a clear separation
of the business logic, presentation output, and request processing. This separation often is referred
to as a Model-View-Controller (MVC) pattern. While the Model 2 architecture might seem overly
complicated, it actually can simplify an application greatly. Web applications built using the
Model 2 approach generally are easier to maintain and can be more extensible than comparable
applications built around the Model 1 architecture.
The MVC architectural pattern is not directly related to web applications. In fact, it's quite
common in Smalltalk applications, which generally have nothing to do with the Web.
21
As we saw in the previous section, the Model 2 approach is concerned with separating
responsibilities in web applications. Allowing a JSP page to handle the responsibilities of receiving
the request, executing some business logic, and then determining the next view to display can
make for an unattractive JSP page, not to mention the maintenance and extensibility problems this
entanglement causes. Application development and maintenance are much easier if the different
components of a web application have clear and distinct responsibilities.
As an example, say you want to integrate security into your web site. Your first page, in this case,
usually is a login screen that collects and validates the username and password. This page then
directs the user to another screen that allows her to continue in a secure manner. However, as there
is nothing to prevent the user from going directly to a page, each page (in a non-MVC world)
needs to be aware of security. This can be accomplished by including a security check on every
page, but that can be unwieldy, especially if there are some pages that need to be secure and some
that do not. In the MVC world, the security is put inside the controller object. Because the
interface to the customer is driven through the controller object, there is a single entry point and a
single location for the security checks to be performed.
The MVC pattern is categorized as a design pattern in many software design books. Although
there is much disagreement on the precise definition of the pattern, there are some fundamental
ideas.
Model
Responsible for the business domain state knowledge
View
Responsible for a presentation view of the business domain
Controller
Responsible for controlling the flow and state of the user input
22
Depending on the type of architecture your application uses, the model portion of the MVC pattern
can take many different forms. In a two-tier application, where the web tier interacts directly with
a data store such as a database, the model classes may be a set of regular Java objects. These
objects may be populated manually from a ResultSet returned by a database query, or they may be
instantiated and populated automatically by an object-to-relational mapping (ORM) framework
such as TopLink or CocoBase.
In a more complex enterprise application (where the web tier communicates with an EJB server,
for example), the model portion of the MVC pattern will be Enterprise JavaBeans. Although the
EJB 2.0 specification made performance improvements through the use of local interfaces, there
still can be a significant performance impact if the web tier attempts to use entity beans directly as
the model portion of the application, due to the overhead of making remote calls. In many cases,
JavaBeans are returned from session beans and used within the web tier. These JavaBeans
commonly referred to as data transfer objects or value objects, are used within the views to build
the dynamic content.
The views within the web tier MVC pattern typically consist of HTML and JSP pages. HTML
pages are used to serve static content, while JSP pages can be used to serve both static and
dynamic content. Most dynamic content is generated in the web tier. However, some applications
may require client-side JavaScript. This does not interfere with or infringe upon the MVC concept.
HTML and JSP are not the only choice for the view. You easily can support WML, for example,
instead of HTML. Because the view is decoupled from the model, you can support multiple views,
each for a different client type, using the same model components.
23
The controller portion of the web tier MVC design generally is a Java servlet. The controller in a
web tier application performs the following duties:
I have been using the term framework in this chapter without having defined what exactly it is, or
how it adds value in software development. In its simplest form, a framework is a set of classes
and interfaces that cooperate to solve a specific type of software problem.
A framework comprises multiple classes or components, each of which may provide an abstraction
of some particular concept.
The framework defines how these abstractions work together to solve a problem.
A good framework should provide generic behavior that many different types of applications can
make use of.
There are many interpretations of what constitutes a framework. Some might consider the classes
and interfaces provided by the Java language a framework, but these are really a library. There's a
subtle, but very important, difference between a software library and a framework. A software
library contains functions or routines that your application can invoke. A framework, on the other
24
hand, provides generic, cooperative components that your application extends to provide a
particular set of functions.
The Struts framework was created by Craig R. McClanahan and donated to the ASF in 2000. Craig
is deeply involved in the expert groups for the Servlet and JSP specifications and wrote a large
portion of the Tomcat 4.0 implementation. He also speaks at various conferences, including
JavaOne and ApacheCon.
Several committees have joined the Struts project, and even more developers have volunteered
their time and effort to improve it and increase its value. As a result, the framework has gone
through several beta releases and a few general availability (GA) releases, and although many new
features have been added, the framework hasn't strayed far from its core ideas.
The Struts group always welcomes new participants. To become a contributor, it's recommended
that you first join the Struts User mailing list. If you like what you see there, take a look at the
Struts Developers mailing list. This is the best way to get started and become familiar with the
direction of the project.
At first, it might seem strange to present building your own framework as an alternative to using
Struts. Why would you want to build frameworks from scratch, when they already exist in many
different forms? The answer is the same reason that other open source or commercial products are
developed. The available selection of products just might not be close enough to your desired
framework, and it might be preferable to build it in-house.
The best advice I can give regarding building your own framework is to ask yourself several
questions:
25
1. Have I taken the time to inspect what's available and build a prototype using an
available framework?
2. What does my application need that doesn't exist in one of the available
frameworks?
3. Can I extend an existing framework to suit my needs or find what I need at another
source and add it?
4. Do I know enough about building this type of framework to be able to meet my
requirements?
Depending on the honest answers to these questions, you might find that building your own
framework isn't the best decision. A good guideline to which many in the software-development
industry subscribe is that if it pertains to your core business, you should build it in-house, but if the
software component is not directly related to your core business, it might be wise to get it
elsewhere. Play to your team's strengths and minimize its weaknesses.
Java script is a scripting language. It is interpreted, which provides an easy development process. It
contains a limited and easy to learn command set and syntax. It is designed to perform a well-
defined task and is well suited to implement small, simple programs. Like other scripting
languages, Java Script eases development and troubleshooting because it is not complied.
Object provides a way to define specific pieces of data related to the item in question, these pieces
are known as properties. In addition, these are supplemented by tasks that can be performed on or
with that information known as methods. Together properties and methods make up objects. The
java script is an object based.
Most of the built-in objects in java script are part of the navigator object hierarchy. The navigator
object hierarchy is built from a single base object called the window object.
26
Quick Development:
Because java script does not require time-consuming compilation, scripts can be developed in a
relatively short period of time. This is enhanced by the fact that most of the interface features, such
as dialog boxes, forms and other GUI elements are handled by the browser and HTML code.
Easy to Learn
While java script may share many similarities with Java, it doesn’t include the complex syntax and
rules of Java.
Platform Independence:
Because the WWW, by its very nature, is platform independent java script programs created for
Netscape Navigator are not tied to any specific hardware platform or Operating System. The same
program code can be used on any platform for which Navigator 2.0 is available.
No Code Hiding:
27
Because the source code of java script presently must be included as part of the HTML source
code for a document, there is no way to protect code from being copied and reused by people who
view your web pages. This raises concerns in the software industry about protection of intellectual
property. The consensus is that java scripts are basically freeware at this point in time.
Lack of Debugging and Development Tools:
Most well developed programming environments include a suite of tools that make
development easier and simplify and speed up the debugging process.
History of MySQL:
We started out with the intention of using the mSQL database system to connect to our tables using
our own fast low-level (ISAM) routines. However, after some testing, we came to the conclusion
that mSQL was not fast enough or flexible enough for our needs. This resulted in a new SQL
interface to our database but with almost the same API interface as mSQL. This API was designed
to allow third-party code that was written for use with mSQL to be ported easily for use with
MySQL.
The derivation of the name MySQL is not clear. Our base directory and a large number of our
libraries and tools have had the prefix “my” for well over 10 years. However, co-founder Monty
Widenius's daughter is also named My. Which of the two gave its name to MySQL is still a
mystery, even for us.
The name of the MySQL Dolphin (our logo) is “Sakila,” which was chosen by the founders of
MySQL AB from a huge list of names suggested by users in our “Name the Dolphin” contest. The
winning name was submitted by Ambrose Twebaze, an Open Source software developer from
Swaziland, Africa. According to Ambrose, the feminine name Sakila has its roots in SiSwati, the
local language of Swaziland. Sakila is also the name of a town in Arusha, Tanzania, near
Ambrose's country of origin, Uganda.
28
The following list describes some of the important characteristics of the MySQL Database
Software. See also Section 1.6, “MySQL Development Roadmap”, for more information about
current and upcoming features.
The server is available as a separate program for use in a client/server networked environment. It is
also available as a library that can be embedded (linked) into standalone applications. Such
applications can be used in isolation or in environments where no network is available.
29
Data Types:
Many data types: signed/unsigned integers 1, 2, 3, 4, and 8 bytes long, FLOAT, DOUBLE, CHAR,
VARCHAR, TEXT, BLOB, DATE, TIME, DATETIME, TIMESTAMP, YEAR, SET, ENUM,
and OpenGIS spatial types.Fixed-length and variable-length records.
Full operator and function support in the SELECT and WHERE clauses of queries.
For example:
mysql> SELECT CONCAT(first_name, ' ', last_name)
FROM citizen
WHERE income/dependents > 10000 AND age > 30;
Full support for SQL GROUP BY and ORDER BY clauses. Support for group
functions (COUNT(), COUNT(DISTINCT ...), AVG(), STD(), SUM(), MAX(),
MIN(), and GROUP_CONCAT()).
Support for LEFT OUTER JOIN and RIGHT OUTER JOIN with both standard
SQL and ODBC syntax.
Support for aliases on tables and columns as required by standard SQL.
DELETE, INSERT, REPLACE, and UPDATE return the number of rows that were
changed (affected). It is possible to return the number of rows matched instead by
setting a flag when connecting to the server
The MySQL-specific SHOW command can be used to retrieve information about
databases, database engines, tables, and indexes.
The EXPLAIN command can be used to determine how the optimizer resolves a
query.
Function names do not clash with table or column names. For example, ABS is a
valid column name. The only restriction is that for a function call, no spaces are al-
lowed between the function name and the ‘(’ that follows it.
You can mix tables from different databases in the same query (as of MySQL 3.22).
30
Security:
A privilege and password system that is very flexible and secure, and that allows host-based
verification. Passwords are secure because all password traffic is encrypted when you connect to a
server.
Handles large databases. We use MySQL Server with databases that contain 50 million records.
We also know of users who use MySQL Server with 60,000 tables and about 5,000,000,000 rows.
Up to 64 indexes per table are allowed (32 before MySQL 4.1.2). Each index may consist of 1 to
16 columns or parts of columns. The maximum index width is 1000 bytes (500 before MySQL
4.1.2). An index may use a prefix of a column for CHAR, VARCHAR, BLOB, or TEXT column
types.
Connectivity:
Clients can connect to the MySQL server using TCP/IP sockets on any platform. On Windows
systems in the NT family (NT, 2000, XP, or 2003), clients can connect using named pipes. On
Unix systems, clients can connect using Unix domain socket files.
In MySQL versions 4.1 and higher, Windows servers also support shared-memory connections if
started with the --shared-memory option. Clients can connect through shared memory by using the
--protocol=memory option.
The Connector/ODBC (MyODBC) interface provides MySQL support for client programs that use
ODBC (Open Database Connectivity) connections. For example, you can use MS Access to
connect to your MySQL server. Clients can be run on Windows or Unix. MyODBC source is
available. All ODBC 2.5 functions are supported, as are many others. The Connector/J interface
provides MySQL support for Java client programs that use JDBC connections. Clients can be run
on Windows or Unix. Connector/J source is available.
31
MySQL Connector/NET enables developers to easily create .NET applications that require secure,
high-performance data connectivity with MySQL. It implements the required ADO.NET interfaces
and integrates into ADO.NET aware tools. Developers can build applications using their choice
of .NET languages. MySQL Connector/NET is a fully managed ADO.NET driver written in 100%
pure C#.
Localization:
The server can provide error messages to clients in many languages.Full support for several
different character sets, including latin1 (cp1252), german, big5, ujis, and more. For example, the
Scandinavian characters ‘å’, ‘ä’ and ‘ö’ are allowed in table and column names. Unicode support is
available as of MySQL 4.1.
All data is saved in the chosen character set. All comparisons for normal string columns are case-
insensitive. Sorting is done according to the chosen character set (using Swedish collation by
default). It is possible to change this when the MySQL server is started. To see an example of very
advanced sorting, look at the Czech sorting code. MySQL Server supports many different
character sets that can be specified at compile time and runtime.
MySQL Server has built-in support for SQL statements to check, optimize, and repair tables.
These statements are available from the command line through the mysqlcheck client. MySQL
also includes myisamchk, a very fast command-line utility for performing these operations on
MyISAM tables.
32
A database is a structured collection of data. It may be anything from a simple shopping list to a
picture gallery or the vast amounts of information in a corporate network. To add, access, and
process data stored in a computer database, you need a database management system such as
MySQL Server. Since computers are very good at handling large amounts of data, database
management systems play a central role in computing, as standalone utilities or as parts of other
applications.
A relational database stores data in separate tables rather than putting all the data in one big
storeroom. This adds speed and flexibility. The SQL part of “MySQL” stands for “Structured
Query Language.” SQL is the most common standardized language used to access databases and is
defined by the ANSI/ISO SQL Standard. The SQL standard has been evolving since 1986 and
several versions exist. In this manual, “SQL-92” refers to the standard released in 1992,
“SQL:1999” refers to the standard released in 1999, and “SQL:2003” refers to the current version
of the standard. We use the phrase “the SQL standard” to mean the current version of the SQL
Standard at any time.
Open Source means that it is possible for anyone to use and modify the software. Anybody can
download the MySQL software from the Internet and use it without paying anything. If you wish,
you may study the source code and change it to suit your needs. The MySQL software uses the
GPL (GNU General Public License), http://www.fsf.org/licenses/, to define what you may and
may not do with the software in different situations.
33
The MySQL Database Server is very fast, reliable, and easy to use.
If that is what you are looking for, you should give it a try. MySQL Server also has a practical set
of features developed in close cooperation with our users. You can find a performance comparison
of MySQL Server with other database managers on our benchmark page.
MySQL Server was originally developed to handle large databases much faster than existing
solutions and has been successfully used in highly demanding production environments for several
years.
Although under constant development, MySQL Server today offers a rich and useful set of
functions. Its connectivity, speed, and security make MySQL Server highly suited for accessing
databases on the Internet.
The MySQL Database Software is a client/server system that consists of a multi-threaded SQL
server that supports different backends, several different client programs and libraries,
administrative tools, and a wide range of application programming interfaces (APIs).
3.5 JDBC
JDBC technology is an API (included in both J2SE and J2EE) that provides cross-DBMS
connectivity to a wide range of SQL databases and access to other tabular data sources, such as
spreadsheets or flat files
URL stands for "Uniform Resource Locator". You will be familiar with HTTP URLs that you
normally use to access a web site e.g. http://www.stardeveloper.com. URLs are used to identify a
resource using a unique name.
34
Same goes for database URLs in JDBC. JDBC requires that all database connection strings should
be represented by URLs. The URLs used in JDBC have following structure:
jdbc:subprotocol:subname
In HTTP you begin a URL with the protocol name i.e. http:, similarly in JDBC driver URLs, you
start the URL with protocol name i.e. jdbc:. Next subprotocol represents the database you want to
connect to e.g. mysql, oracle, odbc etc. While subname provides additional information on how
and where to connect.
Next thing you need to know besides the database URL is the full class name of your JDBC driver
e.g. com.mysql.jdbc.Driver in case of MySQL Connector/J JDBC driver. The name of the driver is
a requirement and is not optional.
You can tell JVM about what driver/s to use by using one of the following methods:
* To load the the driver/s at JVM startup, specify the driver/s in jdbc.drivers system property
like this:
java -Djdbc.drivers=com.mysql.jdbc.Driver YourJavaProgram
* To explicitly load the driver, use Class.forName() method in your code like this:
35
Class.forName("com.mysql.jdbc.Driver").newInstance();
After learning the theory behind connecting to a database, we'll now move on to create a Java
program which will connect to a MySQL database running on your local system.
Apache Tomcat (or Jakarta Tomcat or simply Tomcat) is an open source servlet container
developed by the Apache Software Foundation (ASF). Tomcat implements the Java Servlet and
the JavaServer Pages (JSP) specifications from Sun Microsystems, and provides a "pure Java"
HTTP web server environment for Java code to run.
Tomcat should not be confused with the Apache web server, which is a C implementation of an
HTTP web server; these two web servers are not bundled together. Apache Tomcat includes tools
for configuration and management, but can also be configured by editing XML configuration files.
Catalina
Catalina is Tomcat's servlet container. Catalina implements Sun Microsystems' specifications for
servlet and JavaServer Pages (JSP). The architect for Catalina was Craig McClanahan.
36
Coyote
Coyote is Tomcat's HTTP Connector component that supports the HTTP 1.1 protocol for the web
server or application container. Coyote listens for incoming connections on a specific TCP port on
the server and forwards the request to the Tomcat Engine to process the request and send back a
response to the requesting client.
Jasper
Jasper is Tomcat's JSP Engine. Tomcat 5.x uses Jasper 2, which is an implementation of the Sun
Microsystems's JavaServer Pages 2.0 specification. Jasper parses JSP files to compile them into
Java code as servlets (that can be handled by Catalina). At runtime, Jasper is able to automatically
detect JSP file changes and recompile them.
Jasper 2
Features
Tomcat 5.x
Implements the Servlet 2.4 and JSP 2.0 specifications
Reduced garbage collection, improved performance and scalability
Native Windows and Unix wrappers for platform integration
Faster JSP parsing
Deployment
Experienced users can build and install Tomcat manually from source code after installing such
dependencies as the Java Development Kit and the Apache Ant build tool.Manual installation can
be complex and time consuming so Tomcat is typically installed through the package management
system or by deploying a ready-to-use TurnKey Tomcat appliance that pre-integrates all
dependencies and requires minimal setup[1]. Depending on the usage scenario, Tomcat may either
be deployed as a standalone pure-Java web server or as a component in a more complex
configuration in which it serves as a back-end which handles requests passed to it from a general
purpose web server such as Apache, using a connector such as mod_jk.
3.5 EASYECLIPSE
EasyEclipse's primary purpose is to provide easy-to-install and -use distributions of Eclipse, rather
than develop new code. The code we have developed is for assembling, testing and distributing the
different distributions of EasyEclipse.
This project was started from a search on Google. Although things have improved, this "Eclipse
Download Hell" document still is the fifth document returned by a Google search for “eclipse
download”. Clearly there is still room for improvement in the way Eclipse is distributed.
38
There is an incredible ecosystem around Eclipse, but the needs of individual developers are not yet
particularly well-served. Some of the most common problems for a developer are:
* Very large downloads with many components or plugins you don't need
* Too many similar plugins to choose from
* Version incompatibility between plugins and the Eclipse platform or other plugins
* Complex menus and cluttered user interface
Our focus is supporting Eclipse-based IDEs from the point of view of an individual developer or a
small development team. As a developer, you need a specific and robust set of development tools
in the smallest and simplest package possible – this is what EasyEclipse provides.
Each EasyEclipse distribution is tailored for a specific development environment with just the right
functionality for that environment – no more complexity than necessary and one easy download
and install procedure. And EasyEclipse is free.
39
CHAPTER 4
4.1 OVERVIEW
This chapter highlights the architecture of the System. The different modules of the System have
been discussed in brief with the flow of data and interaction between these modules. Finally the
chapter tells about the system environment needed for deployment of ONLINE INVENTORY.
4. 2 MVC ARCHITECTURE
The model contains the business logic and interact with the persistance storage to store, retrive and
manipulate data.
The view is responsible for dispalying the results back to the user. In Struts the view layer is
implemented using JSP.
The controller handles all the request from the user and selects the appropriate view to return. In
Sruts the controller's job is done by the ActionServlet.
The following events happen when the Client browser issues an HTTP request.
The ActionServlet receives the request.
The struts-config.xml file contains the details regarding the Actions,
ActionForms,ActionMappings and ActionForwards.
During the startup the ActionServelet reads the struts-config.xml file and creates a
database of configuration objects. Later while processing the request the
ActionServletmakes decision by refering to this object.
When the ActionServlet receives the request it does the following tasks.
Bundles all the request values into a JavaBean class which extends Struts ActionForm
class.
Decides which action class to invoke to process the request.
Validate the data entered by the user.
The action class process the request with the help of the model component. The model
interacts with the database and process the request.
After completing the request processing the Action class returns an ActionForward to the
controller.
Based on the ActionForward the controller will invoke the appropriate view.
The HTTP response is rendered back to the user by the view component.
41
Online Inventory
A table is an allocation of space in the database that can contain objects. The database schema
design is independent of any Relational Database Management System (RDBMS) and hence it is a
logical model.
3 INVENTORY_DATE DATETIME
6 ITEM_ID INT
7 ITEM_QTY INT
8 ITEM_PRICE DOUBLE
9 STATUS VARCHAR(45)
44
3 SCRAP_DATE DATETIME
4 ITEM_QTY INT
6 COMMENTS VARCHAR(45)
CHAPTER 5
IMPLEMENTATION
REQUIREMENTS
1) Tomcat Web Server
2) Web Browser
3) My SQL
Output:
MySQL has been installed and database has been created successfully.
Output:
Pages have been created successfully.
Go to the place where WAMP web server is installed. This will be program files where
most software is usually installed.
User Login:
Existing users can enter into the website by entering their username and password.
Sign up:
New users can enter by registering their personal details.
Admin Login:
Administrators can enter into site by entering their username and password.
47
CHAPTER 6
TESTING
The testing process focuses on the logical internals of the software assuring that all the statements
have been tested and also on the functional externals by conducting tests to uncover errors. This
process also ensures that defined input will produce actual results that agree with required results.
Testing is an important part of the Development Life Cycle. The amount of testing required is
related to the size and complexity of the application.
Unit testing concentrates on each unit of the software implemented in the source code. The
developer at the module level carries this out and this testing is white-box oriented. The module
interface is tested to ensure that information properly flows into and out of the program unit under
test.
Integration testing is a systematic technique for constructing the program structure, while at the
same time conducting tests to uncover errors associated with interfacing. That is, the program is
constructed and tested in small segments, which makes it easier to isolate and correct.
The software and other system elements are tested as a whole. The testing team or the project team
carries this out and is black box oriented. At this stage, both the target hardware and software are
available. Test cases derived using black box methodology from the Software Requirement
Specification.
48
1. If inventory clerk tries to enter the stock Quantity is higher than An error message
level. level.
2 System will not allow redundant code in If a redundant code System will throw
Item,Vendor)
3 An item entered in the item master, it will Item entry in item It will be shown in
CHAPTER 7
CONCLUSION
This web application will serve as an effective tool for Small to medium retailers to maintain
optimum stock level and deliver high customer service. As shown in the subsequent screens, Great
Plains does a good job of providing a wide variety of inventory features and functionality. It is true
that setting up this immense amount of data, including default settings and accounts can require a
decent level of effort, as data input is streamlined and inherent data input errors are kept to a
minimum.
FUTURE ENHANCEMENT
Future enhancements will cover the implementation of RFID technique that cut down manual
operations (i.e.) cycle count. It emphasizes shelf inventory and replenishment related activities.
Automated store ordering (AOS) system to improve both the quality and efficiency of the
inventory replenishment decisions in stores.
50
APPENDIX 1
OUTPUTS
3) Item Master
5) Inventory Master
REFERENCES