45
PROJECT REPORT (SIX WEEKS TRAINING) Krishna Pesticides Submitted by Niharika Arora Roll No. 101113032 CDAC, Mohali (Center for advanced Computing) Department of Computer Science and Engineering THAPAR UNIVERSITY, PATIALA (Deemed University) Page 1 of 45

Automate 2

Embed Size (px)

DESCRIPTION

java project on database management system for a shop

Citation preview

Page 1: Automate 2

PROJECT REPORT(SIX WEEKS TRAINING)

Krishna Pesticides

Submitted by

Niharika Arora

Roll No. 101113032

CDAC, Mohali

(Center for advanced Computing)

Department of Computer Science and EngineeringTHAPAR UNIVERSITY, PATIALA

(Deemed University)

Jun-Jul 2013

Page 1 of 37

Page 2: Automate 2

DECLARATION

I hereby declare that the project work entitled (“Krishna Pesticides”) is an

authentic record of my own work carried out at(Mohali) as requirements of 6-

week summer training for the award of degree of B.E.(Computer Science &

Engineering), Thapar University, Patiala, under the guidance of Ms.Rajani

Pathania from 17 June to 26 July,2013.

(Niharika Arora)

Roll No. 101113032

Date: ________________

Page 2 of 37

Page 3: Automate 2

ACKNOWLEDGEMENT

It is my pleasure to be indebted to various people, who directly or indirectly contributed in the development of this work .

I express my sincere gratitude to my teacher Ms.Rajani Pathania for providing me an opportunity to undergo summer training at CDAC ,Mohali.

I am thankful to my friends Tanya , Pranav , Sandeep for their support, cooperation, and motivation provided to me during the training .

I also extend my sincere appreciation to my friend Puja Kumar who provided his valuable suggestions and precious time in accomplishing my project .

Niharika Arora

Roll No. 101113032

Page 3 of 37

Page 4: Automate 2

INDEX

Summary Of the ProjectProject’s Motto

Intended Audience

Features

Types of users

Introduction to the programming

Project

DFD

Ishikawa Diagram

Sequence Diagram

Collaboration Diagram

Activity Diagram

Usecase Diagram

Class Diagram

Page 4 of 37

Page 5: Automate 2

Details of the work

Testing

Conclusion

References

Page 5 of 37

Page 6: Automate 2

SUMMARY

1. PROJECTS MOTTO-

The main aim of the project is to develop a java based application which

would

reduce the burden of businessman for effective handling of stock ,credit , debit

employees and records of various transactions.

2. INTENDED AUDIENCE-

The project is for the businessmen who find difficulty in maintaining the

records for the large stock , credit and debit which help them during filing of

sales and income tax and can save the records of various transaction with the

different companies and retailers.

3. FEATURES-

1. Stock can be added, checked and updated.

2. Remaining amount of retailers and companies can be checked and credit

can be subtracted from retailers account and debit can be added to

companies account.

3. Transactions details of retailers and companies can be checked.

4. Employee information can be updated, checked and new employee can be

added and old employee can be removed.

5. Interface for completing the order of retailer.

4. TYPES OF USER-

Administrator- there are two administrators who have the privileges of system

and they will control all the system.

Page 6 of 37

Page 7: Automate 2

TECHNOLOGIES USED

1. Java

Java is Platform Independent, Secure, Object Oriented, Scalable, and Robust

Programming Language.

It consists of two parts

JVM stands for Java Virtual Machine, which is run time environment to execute the

java programs.

Java API (Application Programming Interface) that consists of inbuilt classes used in

java programs.

Java is a set of several computer software products and specifications from Sun

Microsystems (which has since merged with Oracle Corporation), that together provide a

system for developing application software and deploying it in a cross-platform computing

environment. Java is used in a wide variety of computing platforms from embedded devices

and mobile phones on the low end, to enterprise servers and supercomputers on the high end.

While less common on desktop computers, Java applets are sometimes used to provide

improved and secure functions while browsing the World Wide Web.

Writing in the Java programming language is the primary way to produce code that will be

deployed as Java bytecode. There are, however, bytecode compilers available for other

languages such as Ada, JavaScript, Python, and Ruby. Several new languages have been

designed to run natively on the Java Virtual Machine (JVM), such as Scala, Clojure and

Groovy. Java syntax borrows heavily from C and C++, but object-oriented features are

modeled after Smalltalk and Objective-C. [6] Java eliminates certain low-level constructs

such as pointers and has a very simple memory model where every object is allocated on the

heap and all variables of object types are references. Memory management is handled

through integrated automatic garbage collection performed by the JVM.

2. JDBC (Java Database Connectivity)

It is an API, which is used for the communication of java programs with different

databases. JDBC is a Java-based data access technology (Java Standard Edition platform)

from Sun Microsystems. It is an acronym as it is unofficially referred to as Java Database

Page 7 of 37

Page 8: Automate 2

Connectivity, with DB being universally recognized as the abbreviation for database. This

technology is an API for the Java programming language that defines how a client may

access a database. It provides methods for querying and updating data in a database. JDBC is

oriented towards relational databases. A JDBC-to-ODBC bridge enables connections to any

ODBC-accessible data source in the JVM host environment.

3. Windows Programming

Swings in java is a rich set of components for building GUIs and adding interactivity

to java applications.

Swing includes all the components that you would expect from a modern GUI toolkit

that is table controls, list controls, tree controls, buttons and labels. The basic architecture of

swing is MVC, and are entirely made in java.

4. MySQL

MySQL is used as database, used to store data. It is RDBMS.

Page 8 of 37

Page 9: Automate 2

SOFTWARE REQUIREMENTS

1. JDK 1.7 Net Beans 7.2

2. Database MySQL Database Server 5.0

3. Reports Jasper Reports 3.7.6

4. JDBC Driver for MySQL Database Server mysql-connector-java-5.1.7-bin.jar

5. Operating System Windows 8/Windows 7/Windows Vista / XP

HARDWARE REQUIREMENTS

1. Intel P4 processor with minimum 2.5 GHz Speed

2. RAM: Minimum 1GB

3. Hard Disk: Minimum 40GB

Page 9 of 37

Page 10: Automate 2

Project

1. Login page

It authenticates username and password from database.

Page 10 of 37

Page 11: Automate 2

2. Main menu bar

Any option can be selected for appropriate action.

1 .Logout - back to login page.

2. Stock -further options are Add to Stock, Update Stock, Check Stock.

3. Accounts - further divided into Retailers and Company account

4. Employs - we can add new employee, delete existing, update information of

existing employee, check information of all employees.

5. Order – interface for completing the order of retailers.

Page 11 of 37

Page 12: Automate 2

3. Add new item to stock

Company name is selected first and then its new product is entered and quantity is added after clicking submit button.

We can enter cost price and selling price of that product.

Page 12 of 37

Page 13: Automate 2

4.Add quantity of existing product

Company name is selected first and then its product is selected and quantity is added after clicking submit button.

Page 13 of 37

Page 14: Automate 2

5. Update Stock

Cost Price and selling price of a product can be changed according to the requirement after selecting the company and its product

Page 14 of 37

Page 15: Automate 2

6.Check Stock

Particular company is selected and all products will be displayed in table.

Page 15 of 37

Page 16: Automate 2

7.Retailers Account

If some retailer returns back the money to wholesaler, same amount is subtracted from their account.

First retaile is selected and amount to be deducted is typed in credit field and SUBMIT button is pressed for successful operation.

We can also see previous transaction of that particular selected retailer in table on the right hand side of page.

Page 16 of 37

Page 17: Automate 2

8. Company Account

If wholesaler returns back the money to company, same amount is subtracted from their account.

Company is selected and amount is typed in Credit text field and SUBMIT button is pressed for successful transaction.

We can also see previous transaction of that particular selected company in table on right side of page.

Page 17 of 37

Page 18: Automate 2

9. Add a new employee

Various fields of new employee is entered and add button is pressed.

Id of new employee will be auto incremented from that of previous employees .

Page 18 of 37

Page 19: Automate 2

10. Update Employee

Id of employee is selected and new information is entered and update button is pressed.

Previous information of selected employee will also be shown.

11. Delete Employee

Page 19 of 37

Page 20: Automate 2

Id is selected and delete button is pressed to delete particular employee as id unique.

12. Show Employees

Page 20 of 37

Page 21: Automate 2

Information of all employees is displayed in table format with their id , name, age and salary .

13. Select Order

Page 21 of 37

Page 22: Automate 2

First retailer is selected whose order is to be completed and then product is selected and its quantity is selected and then proceed button is pressed.

User can delete any item from cart by selecting that item and then pressing delete from cart.

Available quantity of every item is also shown before and after selecting that item.

If quantity entered is more than typed then it will generate the available quantity of product as message.

14. Final Order

Page 22 of 37

Page 23: Automate 2

We can see final order with all fields and total amount of the order.

Press SUBMIT to finish the order.

Press BACK to change the order.

15. Order-Successful

Page 23 of 37

Page 24: Automate 2

In previous screen after pressing the SUBMIT button , total amount is added to retailers accounts .

Press OK for another order.

DATABASE DESIGNWe used MYSQL as the backend and used JDBC connectivity to access the database. The

java application access the database using JDBC and output the results according to the

query, which again takes into account the options, selected by the user.

Page 24 of 37

Page 25: Automate 2

The following gives the various tables and their fields used in our database, which was a

major design decision of our project.

1. Stock tables -

SYNGENTA,IIL,FMC,DUPONT

All above 4 tables contain four fields

Product

Quantity

Cost

Selling

Product_name is primary key in above all tables.

All above 4 tables represent the company names which contain product names, its

quantity cost price and selling price.

2. Transaction tables-

Companytrans

Name - represents name of company.

Amt - transaction amount with that particular company.

Date - date of transaction.

Retailtrans

Name – name of retailer.

Amt- transaction amount.

Date - date of transaction.

No primary key in above both tables.

3. Employee Information table-

Emp

Page 25 of 37

Page 26: Automate 2

Empid – this is unique id given to each employee.

ename – name of employee.

Age – age of employee.

Contactno—contact number of employee.

Sal – salary of employees.

Emp_id is primary key and auto increment.

4. Login table –

Login

Username – username of admin.

Password – password of admin.

Username is primary key.

5. Retailers table -

Retailers

Name - name of retailer.

Amt – amount of money given to wholesaler by retailer.

Name is primary key.

6. Company table –

Company

Name – name of company.

Amt – amount of money given to company by

wholesaler.

Page 26 of 37

Page 27: Automate 2

Page 27 of 37

Page 28: Automate 2

DFD Level0

Page 28 of 37

LLogin

Check and

verify

Grant

PermissionError if not

incorrectEnter id and

password

Page 29: Automate 2

Page 29 of 37

Adminstrator

Company transaction

Retailer transaction

AAdminstrator

Select the company

and enter debit

Reflect the

change

in database

Select the

retailer of

particular city

and

enter the credit

Reflect the

change

in database

Page 30: Automate 2

A

Select the id of Select empid

And Enter the new

Employee information of

employee

Page 30 of 37

Add New employee

Delete employeeh Update employee

Check the Stock j

AAdminstrator

Enter the

information

of new

employee

Select the

company

List of stock

displayed

Add new

employee

to database

Delete the

employee

from

database

Retrieve the

stock list

Receive the

Update the

employee

in database

Page 31: Automate 2

TestingCase 1:

when user enter incorrect combination of password and id or any field is left empty, it shows

the message accordingly.

Page 31 of 37

Page 32: Automate 2

Case 2:

During the add to stock, if the entered quantity is negative the it shows the

message.

Page 32 of 37

Page 33: Automate 2

Case 3:If during upation of stock Cost or selling is negative , then it shows the

message as shown in the image.

Case 4:

If the Delete from cart button is pressed before selecting any item from list then

it shows the message as shown in image.

Page 33 of 37

Page 34: Automate 2

Case 5:

If quantity entered is negative or zero then message appears “Please enter some

positive quantiy” as shown in image.

Page 34 of 37

Page 35: Automate 2

Case6:

If the credit is negative value is entered the message appears as shown in image.

Page 35 of 37

Page 36: Automate 2

Case 7:

For changing password, if confirm password is different from new password following error is generated.

Case 8:

For changing password, if old password is incorrect following error is generated.

Page 36 of 37

Page 37: Automate 2

CONCLUSION

This project is useful to those who have to maintain large stock records with transaction

records with others. This project is particularly for the pesticide shop those deal with different

products of different companies but can be modified for the use of other type of business that

have similar requirements. In routine , operations such addition of items to stock, change of

price of items frequently occur, this project provides easy interface to accomplish this task

and saves the time and there is daily to daily transactions with companies and retailers and to

maintain all records of transactions, this project provides all information.

FUTURE SCOPE OF WORK

Many businessmen who even today maintain all records with the help of pen and paper

It is too tough to maintain the records with the use of paper as it requires lot of space to maintain and store all the records so chances of error increases as records increases.

In the case to match the stock record with the actual sales it is easy if it is computerized.

REFERENCES

1. Java, The Complete Reference 7th Edition by Herbert Schildt.

2. My notes from 6- week Core Java training at CDAC, Mohali.

Page 37 of 37