Sie sind auf Seite 1von 82

A

Project Report On Pharmacy Management System Submitted to Technical Education & Research Institute In partial fulfillment of the requirement of the degree of Master of Computer Application

Prepared by: Sunil Singh MCA 4th Semester Roll Number: 1004014026

Project Supervisor:

2011-12

Department of Computer Application Technical Education & Research Institute Post-Graduate College Ghazipur-233001(U.P.)

Preface Watching and observations are the two most common ways of learning and experiencing things. But there are many instances, when it is absolutely vital to know that what to watch and what to observe. This is universal truth. In this era of information super highway, where distance can be covered with a click of the mouse& that too with a blink of an eye, the ocean contains obscene and malicious information too. The same problem is with our programming world. In which data, information knowledge all is of utmost importance but here also some uncomfortable concepts exists. Computers are popular because of their speed and accuracy but its performance The actually relies on the software and hardware component. project Pharmacy Management System is a java swing project that provides complete information about the pharmacy stock of the pharmacy shop.

Introduction

Speedy and efficient information processing is crucial to our socially and highly developed technology. Computer can help the intolerable burden of handling the ever increasing amount or information with government department, public services and business concerns expected to contain because of their ability to analyze information as well as to retain, update and reproduce it because of their versality to present it in a variety of forms. This may also to some extent lead to problems occurring due to information explosion.

About Project

PMS works in every walk of our life. Through the automation of this system one can easily generate the information about the medicine available and in the stock
3

For this efficient software the first and the foremost thing is that all the requirements should be known before hand and the developer should devote its effort for the completion of that requirement which are demanded by the customer should be fulfilled. This system can be used in various education departments and can distribute the copies of the system among the management and staff members for the required information of their customer.

This very handy project for any user and includes following features:-

Having medicine information and total amount payable.

for the help of user it displays each and every detail about required topics

Maintains all the old record for later reference

Have provision for automatic update as per the status

System must handle user enquiry

Software Development Life Cycle

The Software Development Life Cycle, as outlined by Edward Yourdon in his book modern structure analysis (1989) has been followed in this project with minor modifications. The modified life cycle is shown overleaf.

The life cycle consists of the following activities:

1) SURVEY- This activity is also known as feasibility study. It begins with a request from the user for a new system. It involves the following:

Identify the responsible user for a new system.

Clarify the user request

Identify deficiencies in the current system

Establish goals and objectives of new system

Determine the feasibility for new system


5

Prepare the project charter which will guide about the remainder of the project

2) SYSTEM ANALYSIS The objective of the system analysis activity is to develop structured system specification for the proposed system. The structured system specification should describe what the proposed system would do; independent of the technology which will be used to implement these requirements. The structured system specification will be used to implement these requirements. The structured system specification will be called the essential model (also known as logical model). The essential model may itself consist of multiple models, modeling different aspect of the system. Generally three models used for such purpose are:-

DATA FLOW DIAGRAM (DFD) It models the functioning of the system. DFD may consist of following Context diagram Leveled Data Flow Diagram Process specification for Elementary Bubble
6

Data dictionary for the flows and stores on the DFD

ENTITY RELATIONSHIP DIAGRAM It models the functioning of the data and their relationship.

STATE TRANSITION DIAGRAM It models the time dependent behavior of the system.

3) PRLIMINARY DESIGN This activity deals with certain design issues, which are to be finalized in consultation with user. The two most common design issues of relevance to the user are the

automation boundary and the human machine interface. The output of the activity is the user implementation model. The major part of the user implementation model is the specification for the user interface of the proposed system. The user implementation model is also referred to as the physical model of the proposed system. The model, in addition to the essential model , defines the following for the proposed system:

Automation boundary

Report layouts

Layouts of the source documents

Screen Layouts for the data entry form

Menu

4) SYSTEM DESIGN System design involves transformation of the user implementation model into software design. The design specifications of the proposed system consist of mainly database schema.

5) IMPLEMENTATION This activity includes programming, testing and integration of modules into a progressively more complete system.

6) ACCEPTANCE TEST GENERATION This activity generates a set of data that can be used to test the new system before accepting it.

7) QUALITY ASSURANCE Assurance is also known as final testing. This activity requires, as its input acceptance test data generated in acceptance test generation and an integrated system produced by implementation.

About the current system

Advantages of the current system

The project Pharmacy Management System is created in 4GL GUI based system so that it is easy to handle. It also increases the efficiency of the end user, because it will reduce the reluctant jobs, which are tedious to complete. The PHARMASUCITICAL MANAGEMENT SYSTEM also has automated capability to complete job, it automatically generates the reports, so it reduces the work manually.

Advantages of PHARMASUCITICAL MANAGEMENT SYSTEM:-

1. This system will improve the performance of the company.

2. It reduces the tedious jobs like reluctant work, long procedures, automated report generation, up to date information.

3. It will improve the Pharmacy Stock Management, since all the

information is available whenever required.

10

4. It provides quick processing thus helps in transaction and updating in master records can be performed in few records.

5. It provides accurate output.

6. It gives fast answer of queries.

7. The amount of paper is reduced.

8. Better security

10. Economical.

11. Better Control.

11

Deficiencies of the manual system:

1. Lack of immediate retrieval of information - In manual system, lot of time is wasted in retrieving information. Much searching is required before required is found. This wastes a lot of time of the user as well as the person.

2. Lack of immediate information storage In manual system, it is difficult to store information at proper place at that very moment. This is because the person is unable to quickly locate the place where the information is to be stored.

3. Prompts updating not possible Changes are quite natural in all walks of life. Information and stored data also changes from time to time. These changes should be incorporated in the working also to keep the information up to date. However, bringing about changes through the manual system is a slow and tedious process because of which inaccurate information storage occurs.

4. Unplanned working The manual system lacks the element of planned working. Records are not properly maintained. This creates a lot of problems at times like during information retrieval and storage
12

5. Insignificant generation of managerial and strategic reports. In manual system, reports for management are difficult to be generated and strategic reports are impossible. This is because for these reports proper storage of information, its retrieval and its filtering are very important and very tough in manual system.

6. Accuracy The manual system lacks accuracy in working and a number of operations may be performed incorrectly, the computations that are done in the organization may be incorrect and whatever are generated in the system may be inaccurate.

7. Reliability The reliability of the manual system is considered to be low because of the above given reasons including the fact that TO error is human. Any task that is performed by men, always contain the risk of errors.

8. Redundancy of information In manual system, particular information may be stored at a number of places, lending to redundancy. Redundancy of data or information creates a number of problems storage space is wasted; changes at one place are to be made at a number of places and so on.
13

Goals of the proposed system

1. Immediate retrieval of information The main objective of the

new system is to provide for quick and efficient retrieval of information, any type of information would be available to the user whenever he requires. Facility would be provided for online query to cut down on the response time greatly.

2. Immediate storage of information In the proposed system, it

will be easy to store information at any given time at the correct places. The location of storage would be easily available and user will face no difficulty.

3. Prompt updating of information In the proposed system, the

information will always remain up to date as the updating will be prompt and without any efforts. This factor will be of great importance in the proposed system as it determines the integrity of the information stored.

4. Fast computation of information The computation of

information will be quite fast in the proposed system. Not only


14

mathematical calculations, but also logical comparisons will be quick in the new system.

5. Planned approach toward working The working is the service

center information system will be well planned and organized. The data will be stored properly in the data store which will help in retrieval of information as well as in its storage.

6. Accuracy The level of accuracy in the new proposed system

would be higher. All operations and computations would be done correctly and this will ensure that whatever information is coming from the center, it is accurate.

7. Reliability The reliability of the proposed system would be high

due to the above stated reasons. The reason for the increased reliability of the system is that now there would be proper storage of information, its maintenance would be well managed and retrieval would be possible in the desired manner.

8. Non Redundant Information In the new system, utmost care be

taken that no information is repeated, any usage of storage or


15

otherwise. This would assure economic usage of storage or space and consistency in the data stored. This will also help make those changes easily as the change would have to be made only at that very place and no where else.

16

HARDWARE AND SOFTWARE REQUIREMENTS

To make the application smoothly and can be used to its optimum level following Hardware and Software requirements are required:

128 MB of RAM

PENTIUM III processor or equivalent or higher versions.

At least 5GB of Hard disk.

Java Run Time Environment(JRE) jdk1.5 (As Front End Tool)

MS-Access(As Back End Tool)

17

Tools and Platforms

Stay with us on academic presentation on PHARMACY MANAGEMENT SYSTEM. This project is developed on Java Platform using the database technology at its core. As the images and graphics give more appealing effect to the eyes of the user then the other conventional format, so as to make project more effective and to make the project to able to store the information about various entities involved. The project incorporates the use of software tools like:-

JAVA Language Front End MS-Access Back End

The Front end is the software which manages the logical representation of data which Back end manages to manipulate and store data.

18

Introduction

What is java? Java is a general purpose object oriented programming language . It is the first programming language that is not tied to any particular hardware or operating system .The language is based on the concept of an object. Java is highly derived from C++ . Most striking feature of the language is that it is platform neutral language.

There were five primary goals in the creation of the Java language:

It should use the object-oriented programming methodology. It should allow the same program to be executed on multiple systems. It should contain built-in support for using computer networks. It should be designed to execute code from remote sources securely. It should be easy to use and borrow the good parts of older objectoriented languages like C++. operating

Java tools In order to write java application or applets ,one need more than a language . The tools that lets one to write , test , debug programs.
19

Java features Compiler and Interpreted Platform independent Simple Secure Familiar Portable Object-Oriented Robust Multithreaded High performance Distributed Dynamic

Compiler and Interpreted - There is a java compiler , named javac . The java compiler takes input source code files (these files typically have the ext.java) and converts them into compiled bytecode files.The java Interpreter known as javac can be used to execute java application .The interpreter translates bytecode directly into program actions.

20

Platform independent - Java programs can be easily moved from one computer to another, anywhere and anytime.Changes and upgrades made in operating systems, processors and system resources will not force any changes in java programs.

Simple - Java is designed to be easy for programmer to learn and use efficiently.

Secure- When we use a java compatible web browser, we can safely download java applets without fear of virus infection. Java achieves this protection by confining a java program to java execution environment and not allowing it access to other parts of the computer.

Familiar- It is modeled on C, C++ languages. Java code looks like C++.

Portable- Java compiler generates bytecode instructions that can be implemented on any machine and also the size of the primitive data types are machine independent.

Object-Oriented - Java is a true object-oriented language. All program code and data reside within objects and classes.

21

Robust -It provides many safeguards to ensure reliable code. It has strict compile time and run time checking for data types. Designed as a garbage-collected language relieving the programmers and also incorpates the concept of exception handling which captures series errors.

Multithreaded - Java supports handling multiple tasks simultaneously which greatly improves the interactive performance of graphical applications.

High performance - Java performance is impressive for an interpreted language , mainly due to use of immediate bytecode . Use of multithreaded and further its architecture is also designed to reduce overheads during runtime.

Distributed - It has ability to share both data and programs. Java applications can open and access remote objects on internet which enables multiple programmers at multiple remote locations to collaborate and work together on single project.

Dynamic - Java is capable of dynamically in new class libraries , methods and objects .It supports functions written in other languages like C,C++ called as native methods.
22

Automatic garbage collection - One idea behind Java's automatic memory management model is that programmers should be spared the burden of having to perform manual memory management. In some languages the programmer allocates memory to create any object stored on the heap and is responsible for later manually deallocating that memory to delete any such objects. If a programmer forgets to de-allocate memory or writes code that fails to do so in a timely fashion, a memory leak can occur: the program will consume a potentially arbitrarily large amount of memory. In addition, if a region of memory is de-allocated twice, the program can become unstable and may crash.

In Java, this potential problem is avoided by automatic garbage collection. The programmer determines when objects are created and the Java runtime is responsible for managing the objects' lifecycle. The program or other objects can reference an object by holding a reference to it (which, from a low-level point of view, is its address on the heap). When no references to an object remain, the Java garbage collector automatically deletes the unreachable object, freeing memory and preventing a memory leak. Memory leaks may still occur if a

23

programmer's code holds a reference to an object that is no longer needed in other words, they can still occur but at higher conceptual levels.

Comparing Java and C++, it is possible in C++ to implement similar functionality (for example, a memory management model for specific classes can be designed in C++ to improve speed and lower memory fragmentation considerably), with the possibly cost of extra development time and some application complexity. In Java, garbage collection is built in and virtually invisible to the developer. That is, developers may have no notion of when garbage collection will take place as it may not necessarily correlate with any actions being explicitly performed by the code they write. Depending on intended application, this can be beneficial or disadvantageous: the programmer is freed from performing low-level tasks but at the same time lose the option of writing lower level code.

Java Magic: The Bytecode

Bytecode is a highly optimized set of instruction designed to be executed by the java runtime system, which is called Java Virtual Machine and it exists only inside the computer memory.

24

Java Program Source code

Java Compiler

Virtual Machine Bytecode

Process of Compilation

Bytecode Virtual Machine

Java Interpreter

Machine code Real Machine

Process of converting Bytecode into Machine code

Object Oriented Programming Object Oriented Programming is an approach that provides a way of modularizing programs by creating partitioned memory area for both data and functions that can be used as templates for creating copies of such modules on demand.

Objects and Classes - An object is a software bundle of variables and related methods. Objects are key to understanding object-oriented
25

technology. Real-world objects share two characteristics: They all have state and behavior. Software objects are modeled after real-world objects in that they too have state and behavior. A software object maintains its state in one or more variables. A variable is an item of data named by an identifier. A software object implements its behavior with methods. A method is a function (subroutine) associated with an object. In the Java programming language, an object can specify one of four access levels for each of its variables and methods. A class is a blueprint that defines the variables and the methods common to all objects of a certain kind. After you've created the class, you can create any number of objects from that class. When you create an instance of a class, the system allocates enough memory for the object and all its instance variables. Each instance gets its own copy of all the instance variables defined in the class. Classes can also define class variables. A class variable contains information that is shared by all instances of the class .A class can also declare class methods. You can invoke a class method directly from the class, whereas you must invoke instance methods on a particular instance.

Encapsulation - Wrapping of data and methods into a single unit is known as encapsulation. It is the most striking feature of class. The data is not accessible to outside world and only those methods which are wrapped in
26

the class can access it. The insulation of the data from direct access by the program is called data hiding.

Inheritance - Inheritance is the process by which objects of one class acquire the property of objects of another class. Each subclass inherits state .However, subclasses are not limited to the states and behaviors provided to them by their superclass. Subclasses can add variables and methods to the ones they inherit from the superclass. It supports the concept of hierarchical classification it also provides the use of reusability. .

Polymorphism - This means the ability to take more than one form. An operation may exhibit different behaviour in different instances. The behaviour depends upon the types of data used in the operation. It plays an important role in allowing objects having different internal structures to share external interface.

27

VERSION HISTORY

JDK 1.0(January 23, 1996) Initial release.

JDK 1.1(February 19, 1997) - Inner classes added to the language

J2SE 1.2(December 8, 1998) Codename Playground. J2SE 5.0 were rebranded Java2 and the version name "J2SE" (Java 2 Platform, Standard Edition) replaced JDK to distinguish the base platform from J2EE (Java 2 Platform, Enterprise Edition) and J2ME (Java 2 Platform, Micro Edition).

J2SE 1.3(May 8, 2000) Codename Kestrel.

J2SE 1.4(February 6, 2002) Codename Merlin.

J2SE 5.0(September 30, 2004) Codename Tiger.(Originally numbered 1.5, which is still used as the internal version number. [1])

28

Java SE 6 Codename Mustang. As of 2006 this is currently in development under JSR 270. A beta version was released on February 15, 2006.Beta 2 was released on June 15, 2006 and is available at http://java.sun.com/javase/downloads/ea.jsp. The final release is expected autumn 2006.

Java SE 7 Codename Dolphin. This is in the early planning stages. The Dolphin Project will start up in late July, with release estimated in 2008.[3]

29

Java SE - Java Database Connectivity (JDBC)

The Java Database Connectivity (JDBC) API is the industry standard for database-independent connectivity between the Java programming language and a wide range of databases SQL databases and other tabular data sources, such as spreadsheets or flat files. The JDBC API provides a call-level API for SQL-based database access.

JDBC technology allows you to use the Java programming language to exploit "Write Once, Run Anywhere" capabilities for applications that require access to enterprise data. With a JDBC technology-enabled driver, you can connect all corporate data even in a heterogeneous environment.

The JDBC API is the industry standard for database-independent connectivity between the Java programming language and a wide range of databases. The JDBC API provides a call-level API for SQL-based
30

database access. JDBC technology allows you to use the Java programming language to exploit "Write Once, Run Anywhere" capabilities for applications that require access to enterprise data.

JDBC API Overview The JDBC API makes it possible to do three things:

Establish a connection with a database or access any tabular data

source

Send SQL statements Process the results

JDBC Architecture The JDBC API contains two major sets of interfaces: the first is the JDBC API for application writers, and the second is the lower-level JDBC driver API for driver writers. JDBC technology drivers fit into one of four categories. Applications and applets can access databases via the JDBC API using pure Java JDBC technologybased drivers, as shown in this figure:

31

Left side, Type 4: Direct-to-Database Pure Java Driver This style of driver converts JDBC calls into the network protocol used directly by DBMSs, allowing a direct call from the client machine to the DBMS server and providing a practical solution for intranet access.

Right side, Type 3: Pure Java Driver for Database Middleware This style of driver translates JDBC calls into the middleware vendor's protocol, which is then translated to a DBMS protocol by a middleware server. The middleware provides connectivity to many different databases.

The graphic below illustrates JDBC connectivity using ODBC drivers and existing database client libraries.

32

Left side, Type 1: JDBC-ODBC Bridge plus ODBC Driver This combination provides JDBC access via ODBC drivers. ODBC binary code -- and in many cases, database client code -- must be loaded on each client machine that uses a JDBC-ODBC Bridge. Sun provides a JDBC-ODBC Bridge driver, which is appropriate for experimental use and for situations in which no other driver is available.

33

Right side, Type 2: A native API partly Java technology-enabled driver This type of driver converts JDBC calls into calls on the client API for Oracle, Sybase, Informix, DB2, or other DBMS. Note that, like the bridge driver, this style of driver requires that some binary code be loaded on each client machine.

For comparison of driver types, please see the article published in Computerworld.

Partnering for Progress Sun worked with an array of companies in the industry to create and rapidly establish the JDBC API as the industry-standard, open interface for Java applications to access databases.

Industry Momentum Leading database, middleware and tool vendors have been building support for JDBC technology into many new products. This ensures that customers can build portable Java applications while choosing from a

34

wide range of competitive products for the solution best suited to their needs. See the Industry Support page for a list of companies that are shipping products with support for JDBC technology.

Advantages of JDBC Technology Leverage Existing Enterprise Data With JDBC technology, businesses are not locked in any proprietary architecture, and can continue to use their installed databases and access information easily -- even if it is stored on different database management systems.

Simplified Enterprise Development The combination of the Java API and the JDBC API makes application development easy and economical. JDBC hides the complexity of many data access tasks, doing most of the "heavy lifting"for the programmer behind the scenes. The JDBC API is simple to learn, easy to deploy, and
35

inexpensive to maintain.

Zero Configuration for Network Computers With the JDBC API, no configuration is required on the client side. With a driver written in the Java programming language, all the information needed to make a connection is completely defined by the JDBC URL or by a DataSource object registered with a Java Naming and Directory Interface (JNDI) naming service. Zero configuration for clients supports the network computing paradigm and centralizes software maintenance.

Relating JDBC to ODBC There is a very close relationship between API and JDBC architecture and (open database connectivity) ODBC counterparts. The JDBC ODBC bridge enables you to access databases using ODBC drivers from JDBC . JDBC ODBC bridge effectively translate the JDBC API calls into the corresponding ODBC calls . ODBC drivers are available for almost all types of databases. JDBC can access almost all databases . Because of their common ancestry they share some important components:-

36

Driver manager Driver Connection Statement Metadata Resultset

Loads database drivers and manages the connections between the application and the driver Translates API calls into operations for a specific data source A session between an application and a database A SQL statement to perform a query or update operation Information about returned data , database and driver Logical set of columns and rows of data returned by executing a statement

Driver Manager

Connection

Statement

ResultSet

Driver

Database Database

37

The JDBC architecture is based on a collection of java interfaces and classes that together enable you to connect to data sources , to create and execute SQL statements and to retrieve and modify data in a database.

JDBC-ODBC Bridge Driver The JDBC-ODBC Bridge sun.jdbc.odbc.jdbcodbcDriver-is included with JDK and it enables Java applications to access data through drivers written to the ODBC standard. The driver bridge is useful for accessing data in data sources for which no pure JDBC drivers exist. The bridge works by translating the JDBC methods into ODBC function calls.

Key Features

Full Access to Metadata

The JDBC API provides metadata access that enables the development of sophisticated applications that need to understand the underlying facilities and capabilities of a specific database connection.

No Installation A pure JDBC technology-based driver does not require special installation; it is automatically downloaded as part of the applet that makes the JDBC calls.
38

Database Connection Identified by URL JDBC technology exploits the advantages of Internet-standard URLs to identify database connections. The JDBC API includes an even better way to identify and connect to a data source, using a DataSource object, that makes code even more portable and easier to maintain.

In addition to this important advantage, DataSource objects can provide connection pooling and distributed transactions, essential for
39

enterprise database computing. This functionality is provided transparently to the programmer.

Included in the Java Platform As a core part of the Java 2 Platform, the JDBC API is available anywhere that the platform is. This means that your applications can truly write database applications once and access data anywhere. The JDBC API is included in both the Java 2 Platform, Standard Edition (J2SE) and the Java 2 Platform, Enterprise Edition (J2EE), providing server-side functionality for industrial strength scalability.

40

41

APPLETS

What is an Applet? Applets are small applications that are accessed on an internet server, transported over the internet, automatically installed and as a part of web document. It can perform arithmetic operations, display graphics, play sounds, accept user input, and create animation and interactive games.

Capabilities Java applets can be used to build full featured graphical user interface. Applets can communicate over the internet to a host server and even communicate with other applets on a form.

Limitation For java to be truly successful. However, the client security has to be completely assured because of this security measures place some limitations on java applets. By default, applets cannot communicate with any server other than the originating server. Applets also cannot read or write files to the local file system.

42

Applet life cycle

Each applet has 4 major events in its life time:-

Born or initialization state Running state Idle or stopped state Dead or destroyed state

Born or initialization state: - Applet enters the initialization state when it is first loaded. This is achieved by calling the init () method of applet class. The applet is born. If we want then we can override the initialization more than once in the applet program.

Running state - Applet enters the running state when the system calls the start () method of applet class. This occurs automatically after the applet is initialized. We can override the start () method to create a thread to control the applet.

43

Idle or stopped state - An applet becomes idle when it is stopped from running. Stopping occurs automatically when we leave the page containing running applet. We can also do so by calling the stop () method explicitly. Stop () method can be overridden.

Dead or destroyed state - An applet is said to be dead when it is removed from memory. This occurs automatically by invoking the destroy () method when we quit the browser.

Display state - Applet moves to the display state whenever it has to perform some output operations on the screen. This happens immediately after the applet enters into running state. The paint () method is called to accomplish this task. Almost every applet will have a paint method. We can override this method.

44

Abstract Windowing Toolkit

The windowing package The AWT is a very portable windowing library. It is a standard part of java environment and provides all the basic functionality one would expect to use in a modern windowing system .The AWT defines windows according to a class hierarchy that adds functionality and specificity with each level.

The AWT package allows you to develop window-like applications. It allows your applications to run on different windowing systems. The classes in AWT package will allow you to:-

Generate Colors. Draw graphics. Add GUI components like push buttons, scrollbars etc to your applications. Handle user input from mouse and keyboard. Create Containers.

45

Classes like Layout Managers helps in automatically positioning a GUI object when we add it to the container.

46

SWING

SWING is a set of classes that provides powerful and flexible functionality. In addition with several components provided by AWT, swing supplies several exciting additions, including tabbed panes, scroll panes, trees and tables. It also changes the images as the state of any component changes. Swing is built upon the foundation of the AWT. Swing components are written entirely in Java and therefore are Platformindependent .Swing is also termed also light-weight and provide pluggable look and feel. There are 2 Swing classes that are quite important:

Jframe and Component Jframe extends the AWT class Frame. It contains additional features that enable it to support Swing components. JComponent extends the AWT component and Container classes. It is the top level class for all Swing components and provides Swing pluggable look and feel. Here are some of the Swing component classes:

CLASS Abstract Button Button Group

DESCRIPTION Abstract super class for Swing buttons. Encapsulates a mutually exclusive set of buttons.
47

Image Icon JApplet JButton JCheckBox JComboBox JLabels JRadioButton JScrollPane JTabbedPane JTextField JTree

Encapsulates an icon. The SWING version of APPLET. The SWING push button class. The SWING check box class. Encapsulates a combo box . The SWING version of a label. The SWING version of a radio button. Encapsulates a scrollable window. Encapsulates a tabbed window. The SWING version of Text field. Encapsulates a tree based-control.

Here are the some of the components used:

JApplet Applet that use SWING must be subclass of JApplet. JApplet is rich with functionality that is not found in Applet.

Icons Icons are encapsulated by the Image Icon class, which paints an icon from an image.

JLabel Labels are the instances of the JLabel class which extends JComponent. It can display text or icon. These are passive controls that do not support any interaction with the user.

JTextFields Text field is encapsulated by the JTextComponent class which extends JComponent. JTextField allows you to edit one line of text.

48

JButton JButton class provides the functionality of a push button. JButton allows an icon of string to be associated with the push button.

JCheckBox It is supported by the JCheckBox class. It is a control that is used to turn an option on or off.

JTextArea - Text area is encapsulated by the JTextComponent class which extends JComponent. JTextArea allows you to edit multiline of text.

JRadioButton it is supported by the JRadioButton class. It can be configured into a group of check boxes in which only one check box can be checked at any one time.

JComboBox It is provided through the JComboBox class. It normally displays one entry and can also display a drop down list that allows a user to select a different entry.

JScrollPane It is a component that presents a rectangular area in which a component may be viewed. These are implemented in Swing by JScrollPane class.
49

JTree - It is a component that presents a hierarchical view of data. A user has ability to expand individual subtrees. These are implemented in Swing by JTree class.

ADVANTAGES OF (JAVAX) SWING:

1. It provides more powerful and more flexible components possible

in AWT package. For e.g. JButton can have both image as well as text field associated with it which is not possible in awt package.

2. Unlike AWT components SWING components are not

implemented by platform-specific code. Instead they are written entirely in java and therefore are platform independent. Thus term lightweight is used to describe such elements.

3. Further the Swing components can provide pluggable look and feel, which means that it is easy to substitute another appearance and behavior for an element.

50

Database Management System

Introduction:-

51

Database and Database technology are having a major impact on the growing use of computers. It is fair to say that Database play a critical role in almost all area where computers are used, including business, engineering, medicine, low, education, and library science, to name a few. The word Database is in such common use that we must begin by defining a database. Our initial definition is quite general.

A Database is a collection of related data. By data, we mean know facts that can be recorded and that have implicit meaning. For example, consider the name, telephone numbers, and address of the people. We may have recorded this data in an indexed address book, or we may stored it on a diskette, using a personal computer and software such as DBASE 4or5, Ms Access or Ms Excel. This is a collection of related data with an implicit meaning and hence is a database.

52

The preceding definition of database is quite general; for example we may consider the collection of words that make up this page of next to be related data and hence to constitute a database. However, the common use of the term database is usually more restricted. A database has the following implicit property: -

A database represents some aspect of the real world, sometimes called the miniworld or the Universe of Discourse (UoD). Changes to the miniworld are reflected in the database. A database is a logically coherent collection of data with some inherent meaning. A random assortment of data can not correctly be

referred to as a database. A database is designed, built, and populated with data for a specific purpose. It has an intended group of user and some preconceived

53

applications interested.

in

which

these

users

are

In other words, a database has some source from which data are derived, some degree of interaction with events in the real world, and an audience that is actively interested in the contents of the database.

A database can be of any size and of varying complexity. For example, the list of names and address referred to earlier may consist of only a few hundred records, each with a simple structure. On the other hand, the card catalog of a larger library may contain half million card stored under different categoriesby primary authors last name, by subject, by book titlewith each category organized in a l p h a b e t i c o r d e r . A d a t a b a s e of even greater s i z e a n d complexity is maintained by the Internal Revenue Service.

54

A database may be generated and maintained manually or it may be computerized. The library card catalog is an example of a database that may be created and maintained manually. A computerized database may be created and maintained either by a group of application programs written specifically for that task or by a database management system.

A database management system is a collection of programs that enables users to create and maintain a database. The DBMS is hence a general purpose software system that facilitates the processes of defining, constructing, and manipulating database for various applications. Defining a database involved specifying the data types, structures, and constraints for the data to be stored in the database. Constructing the database is the process of storing the data itself on
55

some storage medium that is controlled by the DBMS. Manipulating a database includes such functions as querying the database to retrieve specific data, updating the database to effect changes in the miniworld, and generating reports from the data.

It is not necessary to use general-purpose DBMS software to implement a computerized database. We could write our own set of programs to create and maintain the database, in effect creating our own special-purpose DBMS software. In either casewhether we use a general-purpose DBMS or notwe usually have to employ a considerable amount of software to manipulate the database. We will call the database and DBMS software together a
database system.

56

USER/ PROGRAMMER

DBMS SOFTWARE Application Programs/Queries

DBMS SOFTWARE SOFTWARE TO PROCESS QUERIS / PROGRAMS

SOFTWARE TO ACCESS STORED DATA

Store Database Definition (Metadata)

Store Database

57

58

59

SQL-STRUCTURED QUERY LANGUAGE SQL is not a procedural language. It is not used to define complex processes; we can use SQL to use commands that define and manipulate data. SQL is different from other languages. SQL is very readable. In SQL we always issue commands. SQL statements fall into two groups: Data Defination Language (DDL) DDL statements are used to describe the tables and the data they contain. The subset of SQL statements used for modeling the structure (rather than the contents) of a

60

database or cube. The DDL gives you the ability to create, modify, and remove databases and database objects. Data Manipulation Language (DML) DML statements that are used to operate on data in the database. These are statements that allow you to create or alter objects (such as tables, indexes, views, and so on) in the database. The subset of SQL statements used to retrieve and manipulate data. DML can be further divided into 2 groups: Select Statements Statements that return a set of results. Everything else Statements that dont return a set of results. Here are some of the quries defined:SELECT - SQL statement used to request a selection, projection, join, query, and so on, from a SQL Server database.

Primary key Primary key constraints identify the column or set of columns whose values uniquely identify a row in a table. No two rows in a table can have the same primary key value. You cannot enter a NULL value for any column in a primary key.

61

Insert - The Insert logical operator inserts each row from its input into the object specified in the Argument column. To insert the data into a relation we either specify a tuple to be inserted or write a query. Delete - The Delete logical operator deletes from an object rows that satisfy the optional predicate in the Argument column. We can delete only whole tuples; we cannot delete values on only particular attributes. Update - The Update logical operator updates each row from its input in the object specified in the Argument column. It provides a way of modifying existing data in a table update statement do not return a result set, they merely modify data in the database. If a WHERE :() predicates is present, only those rows that satisfy this predicate are updated. If a SET :() predicate is present, it indicates the value to which each updated column is set. If a DEFINE :() predicate is present, this lists the values that this operator defines.

62

Alter - Adds or removes files, file groups, table. Modifies a table definition by altering, adding or dropping columns and constraints, or by disabling or enabling constraints and triggers. Can also be used to modify the attributes of files and file groups, such as changing the name or size of a file.

MS ACCESS: 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 MS Access. Since computer is very good at handling large amount of data, database. Management places a central goal in computing as standalone utilities, or as parts of other application. MS Access is a relational database management system. A relational database stores data in separate tables rather than all the data in one big storeroom. This adds speed and flexibility. Defined

63

relations making it possible to combine data from several tables on request link the tables. The SQL part of MS Access stands for Structured Query Languagethe most common standardized language used to access database.

MS Access is very fast, reliable and easy to use. If that is what you are looking for, you should give it a trys Access also has a very practical set of features developed in very close cooperation with our users? You can find a performance comparison of MS Access to some other database managers on our

benchmark pages Access is used to handle very large database much faster than existing solutions.

For advanced technical information, MS Access is a client/server system that consists of a multi-threaded backend, libraries. SQL server different that supports different and

several

client

programs

64

It is very likely that you will find that your favorite application/language already supports MS Access.

We want MS Access to be:

The best and the most used database in the world. Available and affordable for all

Easy to use.

Continuously improving while remaining fast and safe.


65

Fun to use and improve.

Free from bugs.

66

Data Flow Diagram

67

Bhiya ji is page pr aapko extended ER diagram banana hai Mujhe nhi aa rha tha . Sorry bt ye aapko khud se karna pd sakta hai

68

Screen Shots

69

WELCOME Splash

70

Main Window

71

Add Medicine window

72

Medicine Updating Window

73

Removing Medicine From Stock

74

Database Diagrame

75

76

77

78

LIMITATIONS

Although I have tried to do the best and try to do well all the things that are possible in a Payroll System, but still the system contains some of the limitations.

The reason of these limitations is the time constraints. Time is the major problem. I have to deliver the project in a particular time period. Thats why I have to leave some topics that actually I want to cover, I am still working on this software and my next goal is to remove these limitations and develop a more efficient and elegant system.

Limitations of the system:-

this project does not support Multi-User System.

the information of expenses is not included in this project.

After removing these and other minor limitations I hope this project will be very efficient and effective.

79

Conclusion

The computer program Pharmacy management system has been designed basically for the private companies and other institutions. By entering the required data one can easily generate the information about the stock and all the old records as well as other services provided through the system. As provided in the introduction we can do many required works on it but it is not based on a particular Pharmacy management system as common idea is taken into consideration while preparing this project so to implement it to any pharmacy shop it may require some modifications as per the requirements. Still surely it will be provided as a great help to any pharmacy shop and will automate his/her work completely motivating them to work more efficiently.

80

BIBLIOGRAPHY

1. J2SE Specification www.sun.com

2. JAVA2 Herbert Schildt

3. Beginning JAVA2(JDK1.5) Ivor Horton

4. Java Programming BlackBoot Holzner

5. Java developer Hand Book BPB publication

6. Programming Java Swing Shen Zokowaski

7. Java2 CMC

8. Programming with Java -E-balaguruSwamy

Websites

www.wikipedia.com
81

www.google.com www.java2us.com www.w3schools.com

82

Das könnte Ihnen auch gefallen