Project Report Mukesh Paswan

download Project Report Mukesh Paswan

of 140

Transcript of Project Report Mukesh Paswan

  • 8/11/2019 Project Report Mukesh Paswan

    1/140

    on

    Submitted for the fulfillment of the requirement of the course for

    the award of the Degree for

    Submitted by:

    ENROLLMENT N0 : 520961019

    NAME : NILU KUMARI

    COURSE : BSCIT

    SEMESTER : 6th

  • 8/11/2019 Project Report Mukesh Paswan

    2/140

    LIBR RY

    M N GEMENT

    SYSTEM

    TITLE OF THE PROJECT

  • 8/11/2019 Project Report Mukesh Paswan

    3/140

    This is to certify that the project entitled Library Management

    Systemsubmitted to Sikkim Manipal University in fulfillment of the

    requirement for the award of (BSCIT),is an original work carried out by

    MISS. NILU KUMARI, Enrollment NO. 520961019. Under the guidance

    of Mr. G.S.PANDEY

    The matter embodied in this project is a genuine work done by

    the student and has been submitted whether to this University or to the

    institute for the fulfillment of the requirement of any course of study.

    .. ..

    Signature of Student Signature of Guide

    Name: NILU KUMARI Name: Mr. G.S.PANDEY

    Course: BSCIT

    Enrollment No.: 520961019

    CERTIFICATE

  • 8/11/2019 Project Report Mukesh Paswan

    4/140

    I here by declare that the work which is being presented in the

    project entitled Library Management System as part of the course

    curriculum of ,BSCIT Sikkim Manipal University of Health, Medical &

    Technological Sciences, Gangtok; is an authentic record of my own work

    carried out under the supervision of MR. G.S.PANDEY.

    I have not submitted the matter embodied in this project for the award of any

    other degree.

    Name: NILU KUMARI

    Course: BSCIT

    Enrollment No.: 520961019

    DECLARATION

  • 8/11/2019 Project Report Mukesh Paswan

    5/140

    AAssaannyyoonneewwhhoohhaasswwrriitttteennaapprroojjeeccttwwoorrkk,,oorrrreesseeaarrcchhwwoorrkk,,iittiissqquuiittee

    iimmppoossssiibblleettooaacckknnoowwlleeddggeebbyynnaammeeeevveerryyiinnddiivviidduuaallwwhhoohhaassppllaayyeeddssoommee

    ppaarrttiinntthhiisswwoorrkk..IIffeeeelliittiissddiiffffiiccuullttttooeexxpprreessssiinnwwoorrddssmmyypprrooffoouunnddsseennssee

    ooffggrraattiittuuddeettoommoossttrreessppeecctteeddppeerrssoonnsswwhhoohheellppeeddmmeettoommaakkeetthhiisswwoorrkk

    ppoossssiibbllee..

    IIaacckknnoowwlleeddggeemmyyggrraattiittuuddeettoorreessppeecctteeddgguuiiddeeMR. G.S.PANDEYwwhhoohhaass

    bbeeeennkkiinnddeennoouugghhttoossuuggggeessttiimmpprroovveemmeennttoofftthhiisswwoorrkkaannddmmaakkeessiittbbrrooaadd,,

    bbaasseedd..

    Name: NILU KUMARI

    Course: BSCIT

    Enrollment No.: 520961019

    ACKNOWLEDGEMENT

  • 8/11/2019 Project Report Mukesh Paswan

    6/140

    Until a few years ago, there was only concept of stand-alone application

    software. There were many problems for saving records, searching old

    records, maintaining database and storing them. There was a major lack in

    security and maintenance. All data either it is administrative use or user

    related were stored in a single PC. Hence, there was a great possibility of

    illegal access.

    Then, two-tier was introduced. It was a major change in the Information

    Technology world. The pattern of storing and accessing data was changes.

    Information became more secure and reliable.

    And now we are using three-tier architecture. It is a great turning point in

    Information technology world. Storing and sharing of data become very easy

    and secure. There is a large flexibility in accessing data or getting

    information from the server placed in geographical dispersed area at one

    place without going there.

    My software is two-tier based; there is a user interface (front end) anddatabase (back end). The client system where software will be installed can

    send request to database and establish connection and access database.

    ABSTRACT

  • 8/11/2019 Project Report Mukesh Paswan

    7/140

    1. Introduction ---------------------------- 1-2

    2. Objectives ----------------------------- 3-4

    3. Problem Statement ---------------------------- 5

    4. Requirement analysis ---------------------------- 6-18

    a. Proposed system

    b. System Requirement `

    c. Software justification

    d. E-R Diagram

    e. Data Flow Diagram

    f. Data Dictionary

    5. Analysis and Design ----------------------------- 19-26

    6. Coding ----------------------------- 27-118

    7. Testing Procedures and Reports ----------------------------- 119-121

    8. Documentation ----------------------------- 122-130

    9. Future Application ----------------------------- 131

    10. Conclusion ----------------------------- 132

    11. Bibliography ----------------------------- 133

    CONTENTS

  • 8/11/2019 Project Report Mukesh Paswan

    8/140

    Library Management System is the process to the Management of any

    particular Library efficiently; it needs supportive phenomena to make

    complex work easy and to perform related Activity with Smart way. Dealing

    in Library and handling lots of books and members is not as easy as it seems

    but its a complex task..Therefore I have tried to handle with concern the problems as to perform

    total Management of Library Management System. Now a days where all

    Business, education, company work, designing work and other platforms are

    being done in a short amount of time and provided least complexity due to

    computerization, so we must consider this & use such a technique to handle

    a large and complex operations which is being performed in a Library as

    well as it would provide a best quality and easiest way for all, related to this

    backing.

    The main view of making of this project is to maintain the data that helps

    Library to keep the right information about all the factors concerned with the

    books and customers. The major factor that attracts all the management is its

    durability and easy maintenance. This project is designed to acquire the

    blessing of different types of work that is performed daily. It is basically a

    group of modules, which makes the work easier to perform.

    INTRODUCTION

  • 8/11/2019 Project Report Mukesh Paswan

    9/140

    As I have used the java programming so it helps me to create this project

    having different modules. Those modules are connected in the group and

    that becomes very easy to me to work together. Data structure helps to

    maintain the record and modify it. It is also used to retrieve the data from the

    Database and helps to update it. It is the next major and important tool which

    is used in my project.

    The present manual Library Management System for a Library requires

    updating of a number of registers daily. It requires huge manpower, effort

    and money. Even though, Maintenance of registers is not done properly.

    This project results in transformation from conventional type system to

    computerized system with day-to-day information. It deals with the whole

    information of the Library like Member details, Book details, Staffs and

    their Salaries, Fees etc. It takes a lot of space to keep the records. If one is

    not very careful then there is a possibility of issuing more than one book to a

    member on one card. When a member requests for a book, one has to

    physically check for the presence of a book in the library. Different registers

    have to be maintained for recording the different Book Details,

    Student/member details and purchase details of different books present in

    the library.

    There is an increased risk of error in the manual system. Redundancy of data

    creeps in the manual system and it becomes a time consuming process to

    answer management queries and prepare management reports. The manual

    registers and files to be maintained increases with the increase in the number

    of Book Titles, and/or increase in the number of library member.

  • 8/11/2019 Project Report Mukesh Paswan

    10/140

    In view of the above, a proposed computerized Library Management

    system application is strongly needed.

    The objective of this Library Management System is to facilitate the ongoing

    routine work of a Library. This project aims in developing an information

    system to store, maintain, update and process the data related to Library

    activities. It will also prepare various types of reports to aid in smooth and

    speedy functioning of the Library activities.

    The softwareLibrary Management Systemwill give options for

    providing full controllability to the user. It will have different options for all

    the activities that are carried out by the Library management. The project

    LIBRARY MANAGEMENT SYSTEM is developed to

    achieve the objective of facilitating a Library with electronic datamanagement which can be accessible from any where in the Library

    networking center. However the different label of securities is

    maintained for unauthorized access.

    .This project has designed to acquire the blessing of different types of

    work that is performed daily. Broadly it has been synthesized to reach the

    totally work approach. The major advantages of this project is, all the

    information can be obtained by selecting one of the particular concerned

    topic given on the top of the front page. It is basically a group of modules,

    which makes the work easier to perform. Library Management System is

    such kind of package used in the Libraries where there is a difficulty in

    OBJECTIVE OF THE PROJECT

  • 8/11/2019 Project Report Mukesh Paswan

    11/140

    maintaining information about books and members. Library Department,

    working for a long period, wants to change there manual working for a long

    period, manual system to computer system.

    The main objective of the project is listed below:

    To keep details of every entry related to the Library like

    member of Library , Director , No. of Books available , Book

    issued , Book returned , Details of Book, etc.

    To give the facility to the user so that they can access the data

    at different level. For example - anyone can browse the catalogue

    list, library records, list of books available etc.

    Providing the facility to theocratic to maintain data electronically

    from anywhere through networking no need to roam here and there.

    Providing security of data and of course from the unauthorized

    user.

    Providing easier way to modify, view , search, remove, update and

    generation of the important reports etc

    To overcome from the problems faced in the manual system. For

    exampleData retrieval and access becomes much faster and easier

    Providing automatic rectification of the mathematical, accounting and

    logical errors

  • 8/11/2019 Project Report Mukesh Paswan

    12/140

    The existing System is not computerized and it is done manually. Here all

    the details are stored in separate files. Therefore the storage and retrieval of

    data becomes very tedious and requires lot of time and human effort.

    Updating the data cannot be made easily. Retrieval of test details of patients

    and case history were very hard. Debugging of errors is very difficult.

    While retrieving the data or updating the data, the whole procedure has to be

    remembered in the current system. Therefore, it has to switch on to a new

    system that is advantageous and easier than this current system. There is no

    security for the data.

    Drawbacks:- Since the existing system is manual, there are changes of

    committing frequent errors.

    Many staffs have to be appointed for this process.

    In case of preparing any reports, the end user has to go through

    every file.

    The maintenance of documents in separate registers is very

    difficult to handle.

    There are changes of misusing the system.

    Wastage of time and money due to manual system.

    PROBLEM STATEMENT

  • 8/11/2019 Project Report Mukesh Paswan

    13/140

    a. PROPOSED SYSTEM :

    All the above limitation was removed. The proposed system is capable of

    helping the management to know that how many patients are treated and

    how many tests are conducted by the clinic and the doctors to whom patientsare referred.

    The proposed system satisfies its benefits by the way in which it

    functions and satisfies the end user according their needs. The computer can

    be operating at high speed, store and retrieve large volume of data very

    quickly. The proposed system is a system using Java as Front End and

    Oracle as Back End tool under Windows XP.

    Effective Management

    Calculating totals charges of tests

    Printing the Invoice Quickly.

    Instant verification of reports

    Error Free and menu driven interface

    Saves lot of time.

    REQUIREMENT ANALYSIS

  • 8/11/2019 Project Report Mukesh Paswan

    14/140

    b. SYSTEM REQUIREMENTS :

    Software Requirements :

    Operating System : MS Windows XP / XP Professional

    Front End : Java (JDK1.6)

    Back End : Oracle 9i

    Others : MS-word, Notepad, MS-paint

    Hardware Requirement :

    CPU : C2D 2.0 GHzRAM : 1 GB

    Hard Disk : 160 GB

    MONITOR : LCD 15

    PRINTER : Canon LaserJet

    DVD R/W : 48X

    UPS : 600VA

  • 8/11/2019 Project Report Mukesh Paswan

    15/140

    c. SOFTWARE JUSTIFICATION :

    Microsoft Windows XP

    The program is working in the Windows environment. Microsoft

    Windows XP is the first operating system coming from Microsoft to

    combine the advantages of the Windows NT core with the ease of use and

    flexibility of the windows 9x series. Basically one can state that windows

    XP is the fusion of the best of Windows 2000 & Windows Me. Microsoft

    Windows XP is available in two different flavors:- The HOME and

    Professional Edition. Behind the green or blue box lies exactly the same

    operating System with a few minor feature differences. The Professional

    edition adds some extra business oriented feature over the Home edition

    with the support of SMP systems and IIS Web server, With its built-in

    accessibility feature and compatibility with more than a dozen assistive

    technology products, the Windows XP Operating System enhances

    accessibility for user with specific vision, hearing, and mobility, cognitive

    and seizure-related disabilities.

    Java

    Java is completely platform independent language. It is a solution of all

    security and portability problems. The output of a java compiler is not

    executable code. Rather, it is byte code. Byte code is a highly optimized set

    of instructions designed to be executed by the Java run-time system, which

    is called the Java Virtual Machine. Byte code makes it much easier to run a

  • 8/11/2019 Project Report Mukesh Paswan

    16/140

    program in a wide variety of environments because only the JVM needs to

    be implemented for each platform.

    The advantage of Java includes:

    o Simple

    o Secure

    o Portable

    o Object-oriented

    o Robust

    o Multithreaded

    o Architecture-neutral

    o Interpreted

    o High performance

    o Distributed

    o Dynamic

    Notepad

    Notepad will be used to write codes and create Readme files. It is inbuilt

    facility provided by operating system.

    MS-Paint

    ms-paint is the facility provided by the operating system itself and it is used

    to draw the picture and image.

    MS-Word

    Ms-paint is provided by Microsoft in the built in pack of ms-office. It is used

    to write codes, documents, read me files, tables, graphics etc

  • 8/11/2019 Project Report Mukesh Paswan

    17/140

    Oracle 9i

    Oracle is one of the more sophisticated relational database

    management system (RDBMSs), allows a great deal of flexibility in its

    configuration and operation. The architecture of Oracle is configured in such

    a way as to ensure that client requests for data retrieval and modification are

    satisfied efficiently while maintaining database integrity. PL/SQL

    (Procedural Language/SQL) is a procedural extension of Oracle-SQL that

    offers language constructs which are necessary in order to implement

    complex data structures and algorithms.

    It includes:

    o Centralized management

    o Reliability

    o Scalability

    o Data dictionary

    o Backup and Recovery

    o Object oriented

    o Automating tasks

  • 8/11/2019 Project Report Mukesh Paswan

    18/140

    Book

    Library

    Contain

    Issue

    MemberReturn

    Status of Return

    Issue

    Status of Issue

    Member ID

    NameAddres

    E-mail

    Book Issued ISBN No

    Book Name

    Member ID

    NameAddres

    E-mail

    Book Issued ISBN No

    Book Name

    E-mail IDName Address

    Ph_No

    Email

    Phone

    No.No.

    Address

    Date_of_Expiry

    Date_of_Joining

    ISBN_NOBook Name

    Date of Arrival

    Price

    Rack No

    Quentity

    d. ER-DIAGRAM

  • 8/11/2019 Project Report Mukesh Paswan

    19/140

    Book Issue

    Book Return

    Stock Update

    Stock Item Delete

    Book Search

    Stock Maintain

    Report

    e. DATA FLOW DIAGRAM:-

    Admin

    Library

    Management

    System

    User

    Login

    New User Register

    B

    o

    o

    k

    S

    s

    e

    a

    r

    c

    h

  • 8/11/2019 Project Report Mukesh Paswan

    20/140

    ISBN_NO

    Book Name

    Author

    Date of Arrival

    Price

    Rack_No

    Quantity

    ISBN_NO

    Book Name

    Author

    Date of Arrival

    Price

    Rack_No

    Quantity

    Top Level DFD

    Admin

    1.0

    Stock UpdateStock Update

    Admin

    1.0

    Stock Item DeleteStock Item Delete

  • 8/11/2019 Project Report Mukesh Paswan

    21/140

    Member_ID

    Name

    Address

    Email Id

    ISBN_No

    Book_Status

    Member_ID

    Name

    AddressEmail Id

    ISBN No.

    Book_Status

    Admin

    Admin

    1.0

    Book Issue

    Book Issue

    1.0

    Book ReturnBook Return

  • 8/11/2019 Project Report Mukesh Paswan

    22/140

    Book Wise

    ISBN_No Wise

    Author Wise

    User

    1.0

    Book SearchBook Search

  • 8/11/2019 Project Report Mukesh Paswan

    23/140

    Book Wise

    ISBN_No WiseAuthor Wise

    ISBN_NO

    Book Name

    Author

    Date of Arrival

    Price

    Rack_No

    QuantityBottom Level DFD

    User

    1.0

    Book SearchBook Search

    Admin

    1.0

    Stock MaintainStock Detai

  • 8/11/2019 Project Report Mukesh Paswan

    24/140

    f.

    DATA TABLE (DICTIONARY):-

    Login Table

    COLUMN_NAME DATA_TYPE COMMENTS

    UserName Varchar2 (30) Name of user

    Password Varchar2 (30) Password

    Login Type Varchar2 (20) Login type

    Stock Maintain

    COLUMN_NAME DATA_TYPE COMMENTS

    Book Name Varchar2 (20) Stock Book Name

    ISBN_NO Varchar2 (20) ISBN No

    Author Varchar2 (20) Book Author

    Year Number(20) Date of Publication

    Quantity Number(20) Book Quantity

    BookIssued Number(20) How many Book Issue

    BookLeft Number(20) How many BookReturn

    Remarks Varchar2(20) Status

    Total Number(20) Total book in Stock

  • 8/11/2019 Project Report Mukesh Paswan

    25/140

    MemberShip

    COLUMN_NAME DATA_TYPE COMMENTS

    Name Varchar2 (15) Users Name

    Password Varchar2(20) Users password

    Address Varchar2 (20) Users Address

    Phone_N0 Number(15) Users Ph_No

    Email Id Varchar2(15) Users Email IdDate of Joining Date Users joining

    Date of Expiry Date Users expiry

    MemberId Varchar2(20) Reg Member Id

    IssuedBook Varchar2(20) Status

    BookId Varchar2(20) ISBNNo.

  • 8/11/2019 Project Report Mukesh Paswan

    26/140

    The most creative and challenging phase of the life cycle is system

    design. The term design describes a final system and the process by which it

    is developed. It refers to the technical specifications that will be applied in

    implementations of the candidate system. The design may be defined as the

    process of applying various techniques and principles for the purpose of

    defining a device, a process or a system with sufficient details to permit its

    physical realization.

    The designers goal is how the output is to be produced and in what

    format. Samples of the output and input are also presented. Second input

    data and database files have to be designed to meet the requirements of the

    proposed output. The processing phases are handled through the program

    Construction and Testing. Finally, details related to justification of the

    system and an estimate of the impact of the candidate system on the user and

    the organization are documented and evaluated by management as a step

    toward implementation.

    The importance of software design can be stated in a single word

    Quality. Design provides us with representations of software that can be

    assessed for quality. Design is the only way where we can accurately

    translate a customers requirements into a complete software product or

    system. Without design we risk building an unstable system that might fail if

    small changes are made. It may as well be difficult to test, or could be one

    whos quality cant be tested. So it is an essential phase in the development

    of a software product.

    ANALYSIS AND DESIGN

  • 8/11/2019 Project Report Mukesh Paswan

    27/140

    Module Description:

    The aim of the project is to provide users a forum to become a member get

    the details of the books available in the library. The administrator can use

    this for their data update, modify, insert and details of the books as well as

    details about the members.

    The project is divided into seven main categories namely

    1. STOCK MAINTAIN MODULE

    2. BOOK SEARCH MODULE

    3. BOOK ISSUE MODULE

    4. BOOK RETURN MODULE5. STOCK UPDATE MODULE

    6. STOCK ITEM DELETE MODULE

    7. REPORT MODULE

    To implement the above modules a whole array of pages are made use

    of. The first interface is the main page which provides access to the

    administrator and the users. Second page is the administrator pages which

    access the above modules. Each of the modules is explained as follows:

    STOCK MAINTAIN: - It is the page which maintains the book details

    its stock i.e. No. of books its price etc in the library and add the new

    books available in the library, ISBN no. of the books details and its

    price for further use.

    BOOK SEARCH: - It is the page which searches books in the library

    easily with the help of its ISBN no., book name and book author

    without anyones help.

  • 8/11/2019 Project Report Mukesh Paswan

    28/140

    BOOK ISSUE: - It is the page which issue no. of books to the user

    and member of the library and its details are added and quantities of

    books are removed from the database.

    BOOK RETURN: - It is the page through which book are returned by

    the member from the library and its details and quantity of books are

    added in the database

    STOCK UPDATE: - It is the page which updates the quantity of the

    books returned, books issued and available books in the database of

    the library so that we should get accurate further details.

    STOCK ITEM DELETE: -It is the page which deletes the books lostor not required in the library from the database and it updates the

    available no. of books.

    REPORT: - It is the page which records all the items books available

    members available, details of the book and no.of books issued to the

    member.

    Identification of the Need:Earlier Library employees did each and every

    work manually. By doing the work manually, there were always great

    chances of errors and dissatisfactions among management also. The manual

    work is tedious and time consuming. It also get pressurize the employees

    regarding their efficiency. Therefore there was always need for a kind of

    software which can fulfill all the above requirement with accuracy in a

    minimum amount of time and sorting all relevant problems using less afford.

    Preliminary Investigation:Since all the works are done manually, thats

    why there is more time requires for little job. Always there is queue of Party

    waiting for their turn. The simple work looks like cumber some one. As a

  • 8/11/2019 Project Report Mukesh Paswan

    29/140

    result employees of the library get pressurize and members/students get

    aggressive, because of suffering of a lot of time. This creates a little more

    dissatisfaction among librarys employee. All either employees or

    member/students want quick service, but this cant be done manually.

    Therefore library management decides to convert manual system into

    electronic i.e. computerization is required. By computerization any type of

    query regarding details/update can be done instantly. customers get

    information regarding any thing in which theyre required in few seconds.

    Simultaneously, information can be viewed in graphical representation such

    that easy for understanding. Storing and retrieval of information are so fast

    that many jobs can be done in respectively lesser time. Computerization

    makes information safer. Also, library management can generate several

    reports, which will help him to plan future strategy for benefit of library

    behalf.

    Feasibility Study:

    An important outcome of the preliminary investigation phase is that the

    package required is feasible and meets the efficiency criterion, the

    workability standard; also it meets the users needs. The various types of

    feasibility are: -

    Technical Feasibility:

    This evaluation determines the following: -

    Whether the technology needed for the proposed system is available

    or not and the origination is capable to bear the cost for

    implementation for this coming S/W or not.

    How this technology integrated within the organization. Technical

    evaluation must also assess whether the existing system can be

    upgraded to use the new technology or the organization has expertise

  • 8/11/2019 Project Report Mukesh Paswan

    30/140

  • 8/11/2019 Project Report Mukesh Paswan

    31/140

    Data flow diagram:-This graphic used was used for defining inputs, process

    and outputs, new symbols are used in there diagrams which may be placed

    in rather in formal way.

    SOFTWARE ENGINEERING PARADIGM APPLIED

    Software engineering is the establishment and use of engineering principles

    in order to obtain economically sound software that is reliable and works

    efficiently on real machine. Software engineering is a layered technology.

    An engineering approach (including software engineering) must rest on an

    organizational commitment to quality.

    The foundation for software engineering is the process layer. Software

    engineering process is the glue that holds the technology layers together and

    enables rational and timely development of software.

    fig : Software Engineering Layers

    TOOLS

    METHODS

    PROCESS

    QUALITY FOCUS

  • 8/11/2019 Project Report Mukesh Paswan

    32/140

    A process model for software engineering is chosen based on the nature of

    the project and application, the methods and tools to be used, and the

    controls and deliverables that are required.

    There are so many software engineering paradigm suggested by expert for

    software development. Software paradigms are used on the nature of project.

    These are:

    Linear Sequential Model

    The Prototype Model

    The RAD Model

    The Incremental Model The Spiral Model

    From the above all software paradigm I have suggested the Linear

    sequential models as the requirement of project. For choosing this model I

    have scan

    The characteristic of the product

    The project environment in which the software team works.

    Linear Sequential model is also called Waterfall model. I have suggested

    this model because it is easy in understanding and also easy in

    implementation. In this model the software development phases are executed

    in linear way. In this model there is no chance of rollback. For development

    I have gone through the following steps as shown in the diagram:

    By using Linear Sequential model I have gone through some difficulty also

    because of Lack of flexibility (Rigid model) no chance of Roll backing.

    In this model there is no option of Roll back. If any have gone forward they

    can not come back.

  • 8/11/2019 Project Report Mukesh Paswan

    33/140

    It creates a cascade structure. By using Linear Sequential model I got so

    many advantages because

    It is the primary concept of software development life cycle.

    It is applicable for those applications which are developed by highly

    experience and expertise organization.

    Project tracking of Waterfall model

    Anal sisDesign Coding Testing Implementation

    System/information

    engineering

    Analysis

    Design

    Coding

    Testing

    Implementation

    Water fall model

  • 8/11/2019 Project Report Mukesh Paswan

    34/140

    MAIN FORM

    LoginForm.java

    import java.awt.*;

    import java.awt.event.*;

    import javax.swing.*;

    import java.io.*;

    import java.sql.*;

    import java.awt.image.*;

    public class LoginForm extends JFrame implements ActionListener

    {

    Connection con=null;

    Statement stmt=null;

    ResultSet rs=null;

    JLabel l,l1,l2,l3,l4,l5,l6,l7,l8,l9;

    JButton b1,b2,fimg,b3;

    JTextField tf1;

    JPasswordField jf1;

    JPanel p1,p2,p3,p4;

    JComboBox cb;

    ImageIcon img;

    Container conn;

    Image icon=Toolkit.getDefaultToolkit().getImage("logo.gif");

    public LoginForm()

    CODING

  • 8/11/2019 Project Report Mukesh Paswan

    35/140

    {

    super("Welcome to Khuda Bakhsh Oriental Public Library");

    setIconImage(icon);

    try

    {

    con=ConnectionOption.Connect();

    stmt=con.createStatement();

    }

    catch(Exception e)

    {

    System.out.println("Error in connection");

    }

    conn=getContentPane();

    conn.setLayout(null);

    conn.setBackground(new Color(102,204,255));

    p1=new JPanel();

    p1.setLayout(null);

    p1.setBackground(new Color(51,102,153));

    p1.setBounds(300,300,250,120);

    p2=new JPanel();

    p2.setLayout(null);

    p2.setBackground(new Color(51,102,153));

    p2.setBounds(300,400,250,80);

    p3=new JPanel();

    p3.setLayout(null);

    p3.setBackground(new Color(51,102,153));

    p3.setBounds(60,20,480,200);

  • 8/11/2019 Project Report Mukesh Paswan

    36/140

    p4=new JPanel();

    p4.setLayout(null);

    p4.setBackground(new Color(102,204,255));

    p4.setBounds(30,300,250,200);

    ImageIcon img=new ImageIcon("library.jpg","Library image");

    fimg=new JButton(img);

    p3.add(fimg);

    fimg.setBounds(5,5,470,190);

    l=new JLabel("Already a member..! ");

    l.setBounds(320,270,250,20);

    l.setForeground(Color.magenta);

    l.setFont(new Font("Arial",Font.BOLD+Font.ITALIC,20));

    l4=new JLabel("Library was situated by");

    l4.setBounds(10,10,250,20);

    l4.setForeground(Color.magenta);

    l4.setFont(new Font("Arial",Font.BOLD+Font.ITALIC,12));

    l5=new JLabel("md.Khuda Bakhsh in 1891");

    l5.setBounds(10,30,250,20);

    l5.setForeground(Color.magenta);

    l5.setFont(new Font("Arial",Font.BOLD+Font.ITALIC,12));

    l6=new JLabel("'An Eastern Library' a book written");

    l6.setBounds(10,60,250,20);

    l6.setForeground(Color.magenta);

    l6.setFont(new Font("Arial",Font.BOLD+Font.ITALIC,12));

    l7=new JLabel("in the identity of Khuda Bakhsh");

    l7.setBounds(10,80,250,20);

  • 8/11/2019 Project Report Mukesh Paswan

    37/140

    l7.setForeground(Color.magenta);

    l7.setFont(new Font("Arial",Font.BOLD+Font.ITALIC,12));

    l1=new JLabel("MemberID");

    l1.setForeground(Color.orange);

    tf1=new JTextField(20);

    tf1.setBounds(125,10,100,20);

    l2=new JLabel("Password");

    l2.setForeground(Color.orange);

    jf1=new JPasswordField(20);

    jf1.setBounds(125,40,100,20);

    l3=new JLabel("MemberType");

    l3.setForeground(Color.orange);

    l1.setBounds(10,10,100,22);

    l2.setBounds(10,40,100,22);

    l3.setBounds(10,70,100,22);

    b1=new JButton("Login");

    b1.setBounds(10,25,100,22);

    b1.setForeground(Color.blue);

    b1.addActionListener(this);

    b2=new JButton("New User");

    b2.setBounds(125,25,100,22);

    b2.setForeground(Color.blue);

    b3=new JButton("About Khuda Bakhsh");

    b3.setBounds(20,130,160,20);

    b3.setForeground(Color.blue);

    b2.addActionListener(this);

    b3.addActionListener(this);

  • 8/11/2019 Project Report Mukesh Paswan

    38/140

    cb=new JComboBox();

    cb.setBounds(125,70,100,20);

    cb.setForeground(Color.blue);

    add(l);

    conn.add(p1);

    conn.add(p2);

    conn.add(p3);

    conn.add(p4);

    p1.add(l1);

    p1.add(l2);

    p1.add(l3);

    p1.add(tf1);

    p1.add(jf1);

    p1.add(cb);

    p2.add(b1);

    p2.add(b2);

    p4.add(l4);

    p4.add(l5);

    p4.add(l6);

    p4.add(l7);

    p4.add(b3);

    cb.addItem("SelectType");

    cb.addItem("admin");

    cb.addItem("user");

    setLocation(300,100);

    setResizable(false);

    setSize(600,550);

  • 8/11/2019 Project Report Mukesh Paswan

    39/140

    b1.setMnemonic('L');

    b2.setMnemonic('N');

    b3.setMnemonic('A');

    show();

    addWindowListener(new win());

    }

    class win extends WindowAdapter

    {

    public void windowClosing(WindowEvent e)

    {

    System.exit(0);

    }

    }

    public void actionPerformed(ActionEvent lbutton)

    {

    if(lbutton.getActionCommand().equals("Login"))

    {

    try

    {

    if(tf1.getText().length()>0 &&

    jf1.getText().length()>0)

    {

    rs=stmt.executeQuery("select * from

    login");

    boolean b1=false;

    while(rs.next() && b1==false)

    {

  • 8/11/2019 Project Report Mukesh Paswan

    40/140

  • 8/11/2019 Project Report Mukesh Paswan

    41/140

    {

    JOptionPane.showMessageDialog(this,"Error in login please enter your

    memberid and password");

    }

    }

    catch(Exception e)

    {

    System.out.println("Error in login");

    }

    }

    if(lbutton.getActionCommand().equals("New User"))

    {

    setVisible(false);

    new MemberForm();

    }

    if(lbutton.getActionCommand().equals("About Khuda

    Bakhsh"))

    {

    setVisible(false);

    new History();

    }

    }

    public static void main(String args[])

    {

    LoginForm lg=new LoginForm();

    lg.setDefaultCloseOperation(EXIT_ON_CLOSE);

  • 8/11/2019 Project Report Mukesh Paswan

    42/140

    }

    }

    AdminLogin.java

    import java.awt.*;

    import java.awt.event.*;

    import javax.swing.*;

    import java.io.*;

    import java.sql.*;

    import java.awt.image.*;public class AdminLogin extends JFrame implements ActionListener

    {

    JMenuBar mb=new JMenuBar();

    JButton m1=new JButton("BookStock");

    JButton m2=new JButton("BookSearch");

    JButton m3=new JButton("BookIssue");

    JButton m4=new JButton("BookReturn");

    JButton m5=new JButton("Update");

    JButton m6=new JButton("Delete");

    JButton m7=new JButton("Report");

    JButton b1;

    JPanel p=new JPanel();

    JPanel p1=new JPanel();

    JPanel p2=new JPanel();

    JLabel l1=new JLabel("WELCOME ADMINISTRATOR");

    ImageIcon img;

    ImageIcon bimg;

  • 8/11/2019 Project Report Mukesh Paswan

    43/140

    JButton fimg;

    Container con=getContentPane();

    Image icon=Toolkit.getDefaultToolkit().getImage("logo.gif");

    public AdminLogin()

    {

    setTitle("Welcome to admin login");

    setIconImage(icon);

    setSize(650,600);

    setVisible(true);

    setJMenuBar(mb);

    p.setBounds(10,300,615,35);

    l1.setBounds(160,180,400,200);

    l1.setForeground(Color.magenta);

    l1.setFont(new Font("Arial",Font.BOLD+Font.ITALIC,20));

    ImageIcon img=new ImageIcon("library.jpg","Library image");

    fimg=new JButton(img);

    ImageIcon bimg=new ImageIcon("back.gif","Button image");

    b1=new JButton(bimg);

    p1.setLayout(null);

    p1.setBackground(new Color(51,102,153));

    p1.setBounds(80,20,490,200);

    p2.setLayout(null);

    p2.setBackground(new Color(51,102,153));

    p2.setBounds(50,245,45,45);

    m1.setForeground(Color.blue);

    m2.setForeground(Color.blue);

    m3.setForeground(Color.blue);

  • 8/11/2019 Project Report Mukesh Paswan

    44/140

    m4.setForeground(Color.blue);

    m5.setForeground(Color.blue);

    m6.setForeground(Color.blue);

    m7.setForeground(Color.blue);

    mb.add(m1);

    mb.add(m2);

    mb.add(m3);

    mb.add(m4);

    mb.add(m5);

    mb.add(m6);

    mb.add(m7);

    con.add(p);

    con.add(p1);

    con.add(p2);

    con.add(l1);

    p.add(mb);

    p1.add(fimg);

    p2.add(b1);

    fimg.setBounds(5,5,480,190);

    b1.setBounds(0,0,45,45);

    con.setLayout(null);

    con.setBackground(new Color(102,204,255));

    m1.addActionListener(this);

    m2.addActionListener(this);

    m3.addActionListener(this);

    m4.addActionListener(this);

    m5.addActionListener(this);

  • 8/11/2019 Project Report Mukesh Paswan

    45/140

    m6.addActionListener(this);

    m7.addActionListener(this);

    b1.addActionListener(this);

    show();

    m1.setMnemonic('B');

    m2.setMnemonic('S');

    m3.setMnemonic('I');

    m4.setMnemonic('R');

    m5.setMnemonic('U');

    m6.setMnemonic('D');

    m7.setMnemonic('P');

    setVisible(true);

    }

    public void actionPerformed(ActionEvent evt)

    {

    if(evt.getSource().equals(m1))

    {

    setVisible(false);

    new BookStock();

    }

    if(evt.getSource().equals(m2))

    {

    setVisible(false);

    new BookSearch();

    }

    if(evt.getSource().equals(m3))

    {

  • 8/11/2019 Project Report Mukesh Paswan

    46/140

  • 8/11/2019 Project Report Mukesh Paswan

    47/140

  • 8/11/2019 Project Report Mukesh Paswan

    48/140

  • 8/11/2019 Project Report Mukesh Paswan

    49/140

    mb.add(m1);

    mb.add(m2);

    con.add(p);

    con.add(p1);

    con.add(p2);

    con.add(l1);

    p.add(mb);

    p1.add(fimg);

    p2.add(b1);

    fimg.setBounds(5,5,480,190);

    b1.setBounds(0,0,45,45);

    con.setLayout(null);

    con.setBackground(new Color(102,204,255));

    m1.addActionListener(this);

    m2.addActionListener(this);

    b1.addActionListener(this);

    m1.setMnemonic('H');

    m2.setMnemonic('S');

    show();

    setVisible(true);

    }

    public void actionPerformed(ActionEvent evt)

    {

    if(evt.getSource().equals(m1))

    {

    setVisible(false);

    new KhudaBakhsh();

  • 8/11/2019 Project Report Mukesh Paswan

    50/140

    }

    if(evt.getSource().equals(m2))

    {

    setVisible(false);

    new ItemSearch();

    }

    if(evt.getSource().equals(b1))

    {

    setVisible(false);

    new LoginForm();

    }

    }

    /*public static void main(String args[])

    {

    UserLogin ul=new UserLogin();

    ul.setDefaultCloseOperation(EXIT_ON_CLOSE);

    }*/

    }

    History.java

    import java.awt.*;

    import java.awt.event.*;

    import javax.swing.*;

    import java.io.*;

    import java.sql.*;

    import java.awt.image.*;

    public class History extends JFrame implements ActionListener

  • 8/11/2019 Project Report Mukesh Paswan

    51/140

    {

    JTextArea ta1;

    JButton b1;

    JPanel p1=new JPanel();

    JPanel p2=new JPanel();

    JLabel l1=new JLabel("Welcome To Khuda Bakhsh Library");

    ImageIcon img;

    ImageIcon bimg;

    JButton fimg;

    Container con=getContentPane();

    Image icon=Toolkit.getDefaultToolkit().getImage("logo.gif");

    String val="HISTORICAL PERSPECTIVE:-\n\n" +

    "Situated on the busy AshokRajpath, close to the

    serene and tranquil\n" +

    "banks of the ganges,in patna,stands the majestic

    'KHUDA BAKHSH \n" +

    "ORIENTAL PUBLIC LIBRARY',a unique

    repository of rare manuscripts in\n" +

    "Arabic, Persian, Urdu, Turkish, Pushto, Hindi and

    Sanskrit related to\n" +

    "various disciplines of knowledge. Besides a large

    collection of printed\n" +

    "books including old and rare prints both in

    oriental and western\n" +

    "language. Another major attraction is its valuable

    collection of 2000\n" +

  • 8/11/2019 Project Report Mukesh Paswan

    52/140

  • 8/11/2019 Project Report Mukesh Paswan

    53/140

  • 8/11/2019 Project Report Mukesh Paswan

    54/140

    b1.addActionListener(this);

    ta1.setEditable(false);

    show();

    setVisible(true);

    }

    public void actionPerformed(ActionEvent evt)

    {

    if(evt.getSource().equals(b1))

    {

    setVisible(false);

    new LoginForm();

    }

    }

    /*public static void main(String args[])

    {

    History hi=new History();

    hi.setDefaultCloseOperation(EXIT_ON_CLOSE);

    }*/

    }

    CCoonnnneeccttiioonnOOppttiioonn..jjaavvaa

    iimmppoorrttjjaavvaa..ssqqll..**;;

    ppuubblliiccccllaassssCCoonnnneeccttiioonnOOppttiioonn

    {{

    ppuubblliiccssttaattiiccCCoonnnneeccttiioonnCCoonnnneecctt(())

    {{

    ffiinnaallSSttrriinngg

  • 8/11/2019 Project Report Mukesh Paswan

    55/140

    ddrriivveerrCCllaassss==""oorraaccllee..jjddbbcc..ddrriivveerr..OOrraacclleeDDrriivveerr"";;

    ffiinnaallSSttrriinngg

    CCoonnnneeccttiioonnUURRLL==""jjddbbcc::oorraaccllee::tthhiinn::@@llooccaallhhoosstt::11552211::ssiimmppyy"";;

    ffiinnaall SSttrriinngguusseerrIIDD==""ssccootttt"";;

    ffiinnaall SSttrriinngguusseerrPPaasssswwoorrdd==""ttiiggeerr"";;

    CCoonnnneeccttiioonnccoonn==nnuullll;;

    ttrryy

    {{

    SSyysstteemm..oouutt..pprriinnttllnn((""LLooaaddiinnggJJDDBBCCDDrriivveerr-->>

    ""++

    dd

    rriivv

    eerrCC

    llaassss++

    ""\\nn

    ""));;

    CCllaassss..ffoorrNNaammee((ddrriivveerrCCllaassss))..nneewwIInnssttaannccee(());;

    SSyysstteemm..oouutt..pprriinnttllnn((""CCoonnnneeccttiioonnttoo--

    >>""++CCoonnnneeccttiioonnUURRLL++""\\nn""));;

    ccoonn==DDrriivveerrMMaannaaggeerr..ggeettCCoonnnneeccttiioonn((CCoonnnneeccttiioonnUURRLL,,uusseerrIIDD,,uusseerrPPaassss

    wwoorrdd));;

    SSyysstteemm..oouutt..pprriinnttllnn((""ccoonnnneeccttiioonneessttaabblliisshheedd""));;

    }}

    ccaattcchh((CCllaassssNNoottFFoouunnddEExxcceeppttiioonnee))

    {{

    ee..pprriinnttSSttaacckkTTrraaccee(());;

    SSyysstteemm..eexxiitt((11));;

    }}

    ccaattcchh((IIlllleeggaallAAcccceessssEExxcceeppttiioonnee))

    {{

    ee..pprriinnttSSttaacckkTTrraaccee(());;

  • 8/11/2019 Project Report Mukesh Paswan

    56/140

    SSyysstteemm..eexxiitt((11));;

    }}

    ccaattcchh((IInnssttaannttiiaattiioonnEExxcceeppttiioonnee))

    {{

    ee..pprriinnttSSttaacckkTTrraaccee(());;

    SSyysstteemm..eexxiitt((11));;

    }}

    ccaattcchh((SSQQLLEExxcceeppttiioonnee))

    {{

    ee..pp

    rriinn

    ttSS

    ttaacckk

    TT

    rraaccee(());;

    SSyysstteemm..eexxiitt((11));;

    }}

    rreettuurrnnccoonn;;

    }}

    ppuubblliiccssttaattiiccvvooiiddmmaaiinn((SSttrriinnggaarrggss[[]]))

    {{

    CCoonnnneeccttiioonnOOppttiioonnccoo==nneewwCCoonnnneeccttiioonnOOppttiioonn(());;

    ////ccoo..ppeerrffoorrmmUUsseerrQQuueerryy(());;

    ////ccoo..cclloosseeCCoonnnneeccttiioonn(());;

    }}

    }}

    BBooookkSSttoocckk..jjaavvaa

    import java.awt.event.*;

    import java.awt.*;

    import javax.swing.*;

    import java.io.*;

  • 8/11/2019 Project Report Mukesh Paswan

    57/140

    import java.sql.*;

    import java.lang.String;

    public class BookStock extends JFrame implements ActionListener

    {

    Connection con=null;

    Statement stmt=null;

    ResultSet rs=null;

    JTextField t1,t2,t3,t4,t5,t6,t7,t8;

    JLabel l1,l2,l3,l4,l5,l6,l7,l8;

    JButton b1,b2;

    Panel p=new Panel();

    Panel p1=new Panel();

    Panel p2=new Panel();

    Container conn;

    ImageIcon bimg;

    Image icon=Toolkit.getDefaultToolkit().getImage("logo.gif");

    public BookStock()

    {

    super("Maintain BookStock");

    setIconImage(icon);

    conn=getContentPane();

    conn.setLayout(null);

    conn.setBackground(new Color(102,204,255));

    ImageIcon bimg=new ImageIcon("back.gif","Button image");

    b2=new JButton(bimg);

    p.setLayout(null);

    p.setBackground(new Color(102,204,255));

  • 8/11/2019 Project Report Mukesh Paswan

    58/140

    p.setBounds(80,40,280,260);

    p1.setLayout(null);

    p1.setBackground(new Color(102,204,255));

    p1.setBounds(80,300,280,40);

    p2.setLayout(null);

    p2.setBackground(new Color(51,102,153));

    p2.setBounds(30,10,45,45);

    b2.setBounds(0,0,45,45);

    setLocation(200,300);

    setSize(450,400);

    l1=new JLabel("MemberID");

    l1.setForeground(Color.magenta);

    t1=new JTextField(20);

    l2=new JLabel("ISBN No.");

    l2.setForeground(Color.magenta);

    t2=new JTextField(20);

    l3=new JLabel("Book Title");

    l3.setForeground(Color.magenta);

    t3=new JTextField(20);

    l4=new JLabel("Author");

    l4.setForeground(Color.magenta);

    t4=new JTextField(20);

    l5=new JLabel("Year");

    l5.setForeground(Color.magenta);

    t5=new JTextField(20);

    l6=new JLabel("quantity");

    l6.setForeground(Color.magenta);

  • 8/11/2019 Project Report Mukesh Paswan

    59/140

    t6=new JTextField(20);

    l7=new JLabel("remarks");

    l7.setForeground(Color.magenta);

    t7=new JTextField(20);

    l8=new JLabel("Remarks");

    l8.setForeground(Color.magenta);

    t8=new JTextField(20);

    b1=new JButton("Add");

    b1.setForeground(Color.blue);

    l1.setBounds(10,10,100,22);

    l2.setBounds(10,40,100,22);

    l3.setBounds(10,70,100,22);

    l4.setBounds(10,100,100,22);

    l5.setBounds(10,130,100,22);

    l6.setBounds(10,160,100,22);

    l7.setBounds(10,190,100,22);

    l8.setBounds(10,220,100,22);

    t1.setBounds(120,10,160,20);

    t2.setBounds(120,40,160,20);

    t3.setBounds(120,70,160,20);

    t4.setBounds(120,100,160,20);

    t5.setBounds(120,130,160,20);

    t6.setBounds(120,160,160,20);

    t7.setBounds(120,190,160,20);

    t8.setBounds(120,220,160,20);

    b1.setBounds(80,10,100,22);

    conn.add(p);

  • 8/11/2019 Project Report Mukesh Paswan

    60/140

    conn.add(p1);

    conn.add(p2);

    p2.add(b2);

    p.add(l2);

    p.add(l3);

    p.add(l4);

    p.add(l5);

    p.add(l6);

    p.add(l7);

    p.add(t2);

    p.add(t3);

    p.add(t4);

    p.add(t5);

    p.add(t6);

    p.add(t7);

    p1.add(b1);

    b1.addActionListener(this);

    b2.addActionListener(this);

    b1.setMnemonic('A');

    try

    {

    con=ConnectionOption.Connect();

    stmt=con.createStatement();

    }

    catch(Exception e)

    {

  • 8/11/2019 Project Report Mukesh Paswan

    61/140

    System.out.println("Error in connection");

    }

    show();

    }

    public void actionPerformed(ActionEvent lbutton)

    {

    if(lbutton.getActionCommand().equals("Add"))

    {

    try

    {

    boolean b1=false;

    con=ConnectionOption.Connect();

    stmt=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,R

    esultSet.CONCUR_UPDATABLE);

    int a=Integer.parseInt(t2.getText());

    String b=t3.getText();

    String c=t4.getText();

    int d=Integer.parseInt(t5.getText());

    int e=Integer.parseInt(t6.getText());

    String f=t7.getText();

    int g=e-0;

    String sql="insert into bookdetails values("+

    a + ",'" + b + "','" + c +"'," + d + "," + e + "," + 0 + "," + g + ",'" + f + "')";

    int status=stmt.executeUpdate(sql);

    if(status>0)

    {

  • 8/11/2019 Project Report Mukesh Paswan

    62/140

    JOptionPane.showMessageDialog(null,"one record inserted");

    }

    else

    {

    JOptionPane.showMessageDialog(null,"sorry record can't be

    inserted");

    }

    b1=true;

    setVisible(false);

    new AdminLogin();

    }

    catch(Exception e)

    {

    System.out.println("Error in insertion" + e);

    }

    }

    if(lbutton.getSource().equals(b2))

    {

    setVisible(false);

    new AdminLogin();

    }

    }

    /*public static void main(String args[])

    {

    BookStock bs=new BookStock();

  • 8/11/2019 Project Report Mukesh Paswan

    63/140

    bs.setDefaultCloseOperation(EXIT_ON_CLOSE);

    }*/

    }

    BookSearch.java

    import java.awt.event.*;

    import java.awt.*;

    import javax.swing.*;

    import java.io.*;

    import java.sql.*;import java.lang.String;

    public class BookSearch extends JFrame implements

    ActionListener,ItemListener

    {

    Connection con=null;

    Statement stmt=null;

    ResultSet rs=null;

    JLabel l1=new JLabel("Filter");

    JComboBox cb=new JComboBox();

    JLabel l2=new JLabel("EnterBookName");

    JLabel l3=new JLabel("EnterAuthorName ");

    JLabel l4=new JLabel("Enter ISBNNo.");

    JLabel sl1=new JLabel("ISBNNo.");

    JLabel sl2=new JLabel("BookTitle");

    JLabel sl3=new JLabel("Author");

    JLabel sl4=new JLabel("Year");

    JLabel sl5=new JLabel("Quantity");

  • 8/11/2019 Project Report Mukesh Paswan

    64/140

  • 8/11/2019 Project Report Mukesh Paswan

    65/140

    setVisible(true);

    setLocation(200,300);

    setSize(500,500);

    p1=new JPanel();

    p1.setLayout(null);

    p1.setBackground(new Color(102,204,255));

    p1.setBounds(80,70,350,50);

    p2=new JPanel();

    p2.setLayout(null);

    p2.setBackground(new Color(102,204,255));

    p2.setBounds(80,140,350,80);

    p3=new JPanel();

    p3.setLayout(null);

    p3.setBackground(new Color(102,204,255));

    p3.setBounds(80,140,350,80);

    p4=new JPanel();

    p4.setLayout(null);

    p4.setBackground(new Color(102,204,255));

    p4.setBounds(80,140,350,80);

    p6=new JPanel();

    p6.setLayout(null);

    p6.setBackground(new Color(102,204,255));

    p6.setBounds(100,240,350,180);

    p5=new JPanel();

    p5.setLayout(null);

    p5.setBackground(new Color(51,102,153));

    p5.setBounds(30,10,45,45);

  • 8/11/2019 Project Report Mukesh Paswan

    66/140

  • 8/11/2019 Project Report Mukesh Paswan

    67/140

    l1.setBounds(10,10,120,30);

    cb.setBounds(160,10,150,25);

    l2.setBounds(10,10,120,30);

    t1.setBounds(160,10,150,25);

    b2.setBounds(110,50,100,25);

    l3.setBounds(10,10,120,30);

    t2.setBounds(160,10,150,25);

    b3.setBounds(110,50,100,25);

    l4.setBounds(10,10,120,30);

    t3.setBounds(160,10,150,25);

    b4.setBounds(110,50,100,25);

    sl1.setForeground(Color.magenta);

    sl2.setForeground(Color.magenta);

    sl3.setForeground(Color.magenta);

    sl4.setForeground(Color.magenta);

    sl5.setForeground(Color.magenta);

    sl6.setForeground(Color.magenta);

    sl1.setBounds(10,10,100,22);

    sl2.setBounds(10,40,100,22);

    sl3.setBounds(10,70,100,22);

    sl4.setBounds(10,100,100,22);

    sl5.setBounds(10,130,100,22);

    sl6.setBounds(10,160,100,22);

    st1.setBounds(120,10,160,20);

    st2.setBounds(120,40,160,20);

    st3.setBounds(120,70,160,20);

    st4.setBounds(120,100,160,20);

  • 8/11/2019 Project Report Mukesh Paswan

    68/140

    st5.setBounds(120,130,160,20);

    st6.setBounds(120,160,160,20);

    p6.add(sl1);

    p6.add(sl2);

    p6.add(sl3);

    p6.add(sl4);

    p6.add(sl5);

    p6.add(sl6);

    p6.add(st1);

    p6.add(st2);

    p6.add(st3);

    p6.add(st4);

    p6.add(st5);

    p6.add(st6);

    cb.addItem("Search");

    cb.addItem("Bookwise");

    cb.addItem("Authorwise");

    cb.addItem("ISBNNo.wise");

    b1.addActionListener(this);

    b2.addActionListener(this);

    b3.addActionListener(this);

    b4.addActionListener(this);

    cb.addItemListener(this);

    p2.setVisible(false);

    p3.setVisible(false);

    p4.setVisible(false);

    p6.setVisible(false);

  • 8/11/2019 Project Report Mukesh Paswan

    69/140

  • 8/11/2019 Project Report Mukesh Paswan

    70/140

    if(evt.getSource().equals(b4))

    {

    try

    {

    con=ConnectionOption.Connect();

    stmt=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,R

    esultSet.CONCUR_UPDATABLE);

    rs=stmt.executeQuery("select * from

    bookdetails");

    boolean b1=false;

    while(rs.next() && b1==false)

    {

    if(t3.getText().equals(rs.getString(1)))

    {

    int acc=rs.getInt(1);

    System.out.println(""+acc);

    String title=rs.getString(2);

    String author=rs.getString(3);

    String year=rs.getString(4);

    String quan=rs.getString(5);

    String book=rs.getString(7);

    String remark=rs.getString(8);

    p6.setVisible(true);

    st1.setText(""+acc);

    st2.setText(""+title);

    st3.setText(""+author);

  • 8/11/2019 Project Report Mukesh Paswan

    71/140

    st4.setText(""+year);

    st5.setText(""+quan);

    st6.setText(""+book);

    }

    }

    }

    catch(Exception ex)

    {

    System.out.println("Error in connection");

    }

    }

    if(evt.getSource().equals(b2))

    {

    try

    {

    con=ConnectionOption.Connect();

    stmt=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,R

    esultSet.CONCUR_UPDATABLE);

    rs=stmt.executeQuery("select * from

    bookdetails");

    boolean b1=false;

    while(rs.next() && b1==false)

    {

    if(t1.getText().equals(rs.getString(2)))

    {

  • 8/11/2019 Project Report Mukesh Paswan

    72/140

    int acc=rs.getInt(1);

    String title=rs.getString(2);

    String author=rs.getString(3);

    String year=rs.getString(4);

    String quan=rs.getString(5);

    String book=rs.getString(7);

    p6.setVisible(true);

    st1.setText(""+acc);

    st2.setText(""+title);

    st3.setText(""+author);

    st4.setText(""+year);

    st5.setText(""+quan);

    st6.setText(""+book);

    }

    }

    }

    catch(Exception ex)

    {

    System.out.println("Error in connection");

    }

    }

    if(evt.getSource().equals(b3))

    {

    try

  • 8/11/2019 Project Report Mukesh Paswan

    73/140

    {

    con=ConnectionOption.Connect();

    stmt=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,R

    esultSet.CONCUR_UPDATABLE);

    rs=stmt.executeQuery("select * from

    bookdetails");

    boolean b1=false;

    while(rs.next() && b1==false)

    {

    if(t2.getText().equals(rs.getString(3)))

    {

    int acc=rs.getInt(1);

    String title=rs.getString(2);

    String author=rs.getString(3);

    String year=rs.getString(4);

    String quan=rs.getString(5);

    String book=rs.getString(7);

    p6.setVisible(true);

    st1.setText(""+acc);

    st2.setText(""+title);

    st3.setText(""+author);

    st4.setText(""+year);

    st5.setText(""+quan);

    st6.setText(""+book);

  • 8/11/2019 Project Report Mukesh Paswan

    74/140

    }

    }

    }

    catch(Exception ex)

    {

    System.out.println("Error in connection");

    }

    }

    }

    public void itemStateChanged(ItemEvent ev)

    {

    if(ev.getSource().equals(cb))

    {

    if(cb.getSelectedIndex()==0)

    {

    p2.setVisible(false);

    p3.setVisible(false);

    p4.setVisible(false);

    p6.setVisible(false);

    }

    if(cb.getSelectedIndex()==1)

    {

    p2.setVisible(true);

    p3.setVisible(false);

    p4.setVisible(false);

    p6.setVisible(false);

  • 8/11/2019 Project Report Mukesh Paswan

    75/140

    }

    if(cb.getSelectedIndex()==2)

    {

    p3.setVisible(true);

    p2.setVisible(false);

    p4.setVisible(false);

    p6.setVisible(false);

    }

    if(cb.getSelectedIndex()==3)

    {

    p4.setVisible(true);

    p2.setVisible(false);

    p3.setVisible(false);

    p6.setVisible(false);

    }

    }

    }

    /*public static void main(String args[])

    {

    BookSearch bs=new BookSearch();

    bs.setDefaultCloseOperation(EXIT_ON_CLOSE);

    }*/

    }

    BookIssue.java

    import java.awt.event.*;

    import java.awt.*;

  • 8/11/2019 Project Report Mukesh Paswan

    76/140

    import javax.swing.*;

    import java.io.*;

    import java.sql.*;

    import java.lang.String;

    public class BookIssue extends JFrame implements ActionListener,

    FocusListener

    {

    Connection con=null;

    Statement stmt=null;

    ResultSet rs=null;

    ResultSet rset=null;

    JTextField t1,t2,t3,t4,t5,t6,t7,t8;

    JLabel l1,l2,l3,l4,l5,l6,l7,l8;

    JButton b1,b2;

    Panel p=new Panel();

    Panel p1=new Panel();

    Panel p2=new Panel();

    Container conn;

    ImageIcon bimg,image;

    Image icon=Toolkit.getDefaultToolkit().getImage("logo.gif");

    public BookIssue()

    {

    super("Book Issue");

    conn=getContentPane();

    conn.setLayout(null);

    conn.setBackground(new Color(102,204,255));

    setIconImage(icon);

  • 8/11/2019 Project Report Mukesh Paswan

    77/140

    ImageIcon bimg=new ImageIcon("back.gif","Button image");

    ImageIcon image=new ImageIcon("book.jpg","logo image");

    b2=new JButton(bimg);

    p.setLayout(null);

    p.setBackground(new Color(102,204,255));

    p.setBounds(80,40,280,260);

    p1.setLayout(null);

    p1.setBackground(new Color(102,204,255));

    p1.setBounds(80,300,280,40);

    p2.setLayout(null);

    p2.setBackground(new Color(51,102,153));

    p2.setBounds(30,10,45,45);

    b2.setBounds(0,0,45,45);

    setLocation(200,300);

    setSize(450,400);

    l1=new JLabel("MemberID");

    l1.setForeground(Color.magenta);

    t1=new JTextField(40);

    l2=new JLabel("Name");

    l2.setForeground(Color.magenta);

    t2=new JTextField(40);

    l3=new JLabel("Address");

    l3.setForeground(Color.magenta);

    t3=new JTextField(40);

    l4=new JLabel("Phone No.");

    l4.setForeground(Color.magenta);

  • 8/11/2019 Project Report Mukesh Paswan

    78/140

    t4=new JTextField(40);

    l5=new JLabel("Email Id");

    l5.setForeground(Color.magenta);

    t5=new JTextField(40);

    l6=new JLabel("ISBNNo.");

    l6.setForeground(Color.magenta);

    t6=new JTextField(40);

    l7=new JLabel("Status");

    l7.setForeground(Color.magenta);

    t7=new JTextField(40);

    l8=new JLabel("BookIssued");

    l8.setForeground(Color.magenta);

    t8=new JTextField(40);

    b1=new JButton("Book Issued");

    b1.setForeground(Color.blue);

    l1.setBounds(10,10,100,22);

    l2.setBounds(10,40,100,22);

    l3.setBounds(10,70,100,22);

    l4.setBounds(10,100,100,22);

    l5.setBounds(10,130,100,22);

    l8.setBounds(10,160,100,22);

    l6.setBounds(10,190,100,22);

    l7.setBounds(10,220,100,22);

    t1.setBounds(120,10,160,20);

    t2.setBounds(120,40,160,20);

    t3.setBounds(120,70,160,20);

    t4.setBounds(120,100,160,20);

  • 8/11/2019 Project Report Mukesh Paswan

    79/140

    t5.setBounds(120,130,160,20);

    t8.setBounds(120,160,160,20);

    t6.setBounds(120,190,160,20);

    t7.setBounds(120,220,160,20);

    b1.setBounds(80,10,120,22);

    conn.add(p);

    conn.add(p1);

    conn.add(p2);

    p2.add(b2);

    p.add(l1);

    p.add(l2);

    p.add(l3);

    p.add(l4);

    p.add(l5);

    p.add(l6);

    p.add(l7);

    p.add(l8);

    p.add(t1);

    p.add(t2);

    p.add(t3);

    p.add(t4);

    p.add(t5);

    p.add(t6);

    p.add(t7);

    p.add(t8);

    p1.add(b1);

    b1.addActionListener(this);

  • 8/11/2019 Project Report Mukesh Paswan

    80/140

    b2.addActionListener(this);

    t1.addFocusListener(this);

    t6.addFocusListener(this);

    b1.setMnemonic('I');

    try

    {

    con=ConnectionOption.Connect();

    stmt=con.createStatement();

    }

    catch(Exception e)

    {

    System.out.println("Error in connection");

    }

    show();

    t2.setEditable(false);

    t3.setEditable(false);

    t4.setEditable(false);

    t5.setEditable(false);

    t7.setEditable(false);

    t8.setEditable(false);

    }

    public void focusGained(FocusEvent e)

    {

    if(e.getSource().equals(t1))

    {

    if(t1.getText().length()>=0)

    { }

  • 8/11/2019 Project Report Mukesh Paswan

    81/140

    }

    if(e.getSource().equals(t6))

    {

    try

    {

    con=ConnectionOption.Connect();

    stmt=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,R

    esultSet.CONCUR_UPDATABLE);

    rs=stmt.executeQuery("select * from

    memberdetails");

    boolean b1=false;

    while(rs.next() && b1==false)

    {

    if(t1.getText().equals(rs.getString(1)))

    {

    int mid=rs.getInt(1);

    System.out.println(""+mid);

    String name=rs.getString(3);

    String add=rs.getString(4);

    String phone=rs.getString(5);

    String email=rs.getString(6);

    String book=rs.getString(9);

    t2.setText(""+name);

    t3.setText(""+add);

    t4.setText(""+phone);

  • 8/11/2019 Project Report Mukesh Paswan

    82/140

  • 8/11/2019 Project Report Mukesh Paswan

    83/140

  • 8/11/2019 Project Report Mukesh Paswan

    84/140

    stmt=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,R

    esultSet.CONCUR_UPDATABLE);

    rset=stmt.executeQuery("select * from

    bookdetails");

    boolean b=false;

    while(rset.next() && b==false)

    {

    if(t6.getText().equals(rset.getString(1)))

    {

    int quan=rset.getInt(5);

    int issued=rset.getInt(6);

    issued++;

    int left=quan - issued;

    String sql="update bookdetails

    set bookissued=(" + issued + "), bookleft=(" + left + ") where

    accountnumber=('" + rset.getString(1) + "')";

    int

    status=stmt.executeUpdate(sql);

    if(status>0)

    {

    try

    {

    con=ConnectionOption.Connect();

  • 8/11/2019 Project Report Mukesh Paswan

    85/140

    stmt=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,R

    esultSet.CONCUR_UPDATABLE);

    rs=stmt.executeQuery("select *

    from memberdetails");

    while(rs.next())

    {

    if(t1.getText().equals(rs.getString(1)))

    {

    int mid=rs.getInt(1);

    System.out.println(""

    +mid);

    String

    bid=rs.getString(9);

    bid="yes";

    System.out.println(""

    +bid);

    String book=t6.getText();

    System.out.println(""

    +book);

    String q="update

    memberdetails set bookissued=('" + bid + "'), bookid=('" + book + "') where

    memberid=(" + mid + ")";

    int

    status1=stmt.executeUpdate(q);

    }

  • 8/11/2019 Project Report Mukesh Paswan

    86/140

    }

    }

    catch(Exception e)

    {

    System.out.println("Error" );

    }

    JOptionPane.showMessageDialog(null,"one book issued");

    }

    else

    {

    JOptionPane.showMessageDialog(null,"sorry book can't be issued");

    }

    }

    }

    }

    catch(Exception e)

    {

    System.out.println("Error in issue" );

    }

    setVisible(false);

    new AdminLogin();

    }

    if(evt.getSource().equals(b2))

    {

    setVisible(false);

  • 8/11/2019 Project Report Mukesh Paswan

    87/140

    new AdminLogin();

    }

    }

    /*public static void main(String args[])

    {

    BookIssue bi=new BookIssue();

    //bi.setDefaultCloseOperation(EXIT_ON_CLOSE);

    }*/

    }

    BookReturn.java

    import java.awt.event.*;

    import java.awt.*;

    import javax.swing.*;

    import java.io.*;

    import java.sql.*;

    import java.lang.String;

    public class BookReturn extends JFrame implements ActionListener,

    FocusListener

    {

    Connection con=null;

    Statement stmt=null;

    ResultSet rs=null;

    ResultSet rset=null;

    JTextField t1,t2,t3,t4,t5,t6,t7,t8;

    JLabel l1,l2,l3,l4,l5,l6,l7,l8;

    JButton b1,b2;

  • 8/11/2019 Project Report Mukesh Paswan

    88/140

    Panel p=new Panel();

    Panel p1=new Panel();

    Panel p2=new Panel();

    Container conn;

    ImageIcon bimg;

    Image icon=Toolkit.getDefaultToolkit().getImage("logo.gif");

    public BookReturn()

    {

    super("Book Return");

    setIconImage(icon);

    conn=getContentPane();

    conn.setLayout(null);

    conn.setBackground(new Color(102,204,255));

    ImageIcon bimg=new ImageIcon("back.gif","Button image");

    b2=new JButton(bimg);

    p.setLayout(null);

    p.setBackground(new Color(102,204,255));

    p.setBounds(80,40,280,260);

    p1.setLayout(null);

    p1.setBackground(new Color(102,204,255));

    p1.setBounds(80,300,280,40);

    p2.setLayout(null);

    p2.setBackground(new Color(51,102,153));

    p2.setBounds(30,10,45,45);

    b2.setBounds(0,0,45,45);

    setLocation(200,300);

    setSize(450,400);

  • 8/11/2019 Project Report Mukesh Paswan

    89/140

    l1=new JLabel("MemberID");

    l1.setForeground(Color.magenta);

    t1=new JTextField(20);

    l2=new JLabel("Name");

    l2.setForeground(Color.magenta);

    t2=new JTextField(20);

    l3=new JLabel("Address");

    l3.setForeground(Color.magenta);

    t3=new JTextField(20);

    l4=new JLabel("Phone No.");

    l4.setForeground(Color.magenta);

    t4=new JTextField(20);

    l5=new JLabel("Email Id");

    l5.setForeground(Color.magenta);

    t5=new JTextField(20);

    l6=new JLabel("Account No.");

    l6.setForeground(Color.magenta);

    t6=new JTextField(20);

    l7=new JLabel("Status");

    l7.setForeground(Color.magenta);

    t7=new JTextField(20);

    l8=new JLabel("BookStatus");

    l8.setForeground(Color.magenta);

    t8=new JTextField(20);

    b1=new JButton("Book Returned");

    b1.setForeground(Color.blue);

    l1.setBounds(10,10,100,22);

  • 8/11/2019 Project Report Mukesh Paswan

    90/140

    l2.setBounds(10,40,100,22);

    l3.setBounds(10,70,100,22);

    l4.setBounds(10,100,100,22);

    l5.setBounds(10,130,100,22);

    l8.setBounds(10,160,100,22);

    l6.setBounds(10,190,100,22);

    l7.setBounds(10,220,100,22);

    t1.setBounds(120,10,160,20);

    t2.setBounds(120,40,160,20);

    t3.setBounds(120,70,160,20);

    t4.setBounds(120,100,160,20);

    t5.setBounds(120,130,160,20);

    t8.setBounds(120,160,160,20);

    t6.setBounds(120,190,160,20);

    t7.setBounds(120,220,160,20);

    b1.setBounds(60,10,120,22);

    conn.add(p);

    conn.add(p1);

    conn.add(p2);

    p2.add(b2);

    p.add(l1);

    p.add(l2);

    p.add(l3);

    p.add(l4);

    p.add(l5);

    p.add(l6);

    p.add(l7);

  • 8/11/2019 Project Report Mukesh Paswan

    91/140

    p.add(l8);

    p.add(t1);

    p.add(t2);

    p.add(t3);

    p.add(t4);

    p.add(t5);

    p.add(t6);

    p.add(t7);

    p.add(t8);

    p1.add(b1);

    b1.addActionListener(this);

    b2.addActionListener(this);

    t1.addFocusListener(this);

    t6.addFocusListener(this);

    b1.setMnemonic('R');

    try

    {

    con=ConnectionOption.Connect();

    stmt=con.createStatement();

    }

    catch(Exception e)

    {

    System.out.println("Error in connection");

    }

    show();

    t2.setEditable(false);

    t3.setEditable(false);

  • 8/11/2019 Project Report Mukesh Paswan

    92/140

    t4.setEditable(false);

    t5.setEditable(false);

    t7.setEditable(false);

    t8.setEditable(false);

    }

    public void focusGained(FocusEvent e)

    {

    if(e.getSource().equals(t1))

    {

    if(t1.getText().length()>=0)

    {

    }

    }

    if(e.getSource().equals(t6))

    {

    try

    {

    con=ConnectionOption.Connect();

    stmt=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,R

    esultSet.CONCUR_UPDATABLE);

    rs=stmt.executeQuery("select * from

    memberdetails");

    boolean b1=false;

    while(rs.next() && b1==false)

    {

    if(t1.getText().equals(rs.getString(1)))

  • 8/11/2019 Project Report Mukesh Paswan

    93/140

    {

    int mid=rs.getInt(1);

    System.out.println(""+mid);

    String name=rs.getString(3);

    String add=rs.getString(4);

    String phone=rs.getString(5);

    String email=rs.getString(6);

    String book=rs.getString(9);

    t2.setText(""+name);

    t3.setText(""+add);

    t4.setText(""+phone);

    t5.setText(""+email);

    t8.setText(""+book);

    }

    }

    }

    catch(Exception ex)

    {

    System.out.println("Error in connection");

    }

    }

    }

    public void focusLost(FocusEvent e)

    {

    if(e.getSource().equals(t1))

    {

  • 8/11/2019 Project Report Mukesh Paswan

    94/140

    t6.requestFocus();

    }

    if(e.getSource().equals(t6))

    {

    b1.requestFocus();

    try

    {

    con=ConnectionOption.Connect();

    stmt=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,R

    esultSet.CONCUR_UPDATABLE);

    rs=stmt.executeQuery("select * from

    bookdetails");

    boolean b1=false;

    while(rs.next() && b1==false)

    {

    if(t6.getText().equals(rs.getString(1)))

    {

    int mid=rs.getInt(1);

    String quan=rs.getString(7);

    t7.setText(""+quan);

    }

    }

    }

    catch(Exception ex)

    {

  • 8/11/2019 Project Report Mukesh Paswan

    95/140

    System.out.println("Error in connection");

    }

    }

    }

    public void actionPerformed(ActionEvent evt)

    {

    if(evt.getSource().equals(b1))

    {

    try

    {

    con=ConnectionOption.Connect();

    stmt=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,R

    esultSet.CONCUR_UPDATABLE);

    rset=stmt.executeQuery("select * from

    bookdetails");

    boolean b=false;

    while(rset.next() && b==false)

    {

    if(t6.getText().equals(rset.getString(1)))

    {

    int quan=rset.getInt(5);

    int ret=rset.getInt(6);

    ret--;

    int left=quan - ret;

  • 8/11/2019 Project Report Mukesh Paswan

    96/140

    String sql="update bookdetails

    set bookissued=(" + ret + "), bookleft=(" + left + ") where

    accountnumber=('" + rset.getString(1) + "')";

    int

    status=stmt.executeUpdate(sql);

    if(status>0)

    {

    try

    {

    con=ConnectionOption.Connect();

    stmt=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,R

    esultSet.CONCUR_UPDATABLE);

    rs=stmt.executeQuery("select *

    from memberdetails");

    while(rs.next())

    {

    if(t1.getText().equals(rs.getString(1)))

    {

    int mid=rs.getInt(1);

    System.out.println(""

    +mid);

    String

    bid=rs.getString(9);

  • 8/11/2019 Project Report Mukesh Paswan

    97/140

    bid="no";

    System.out.println(""

    +bid);

    String q="update

    memberdetails set bookissued=('" + bid + "'),bookid=('" + null + "') where

    memberid=(" + mid + ")";

    int

    status1=stmt.executeUpdate(q);

    }

    }

    }

    catch(Exception e)

    {

    System.out.println("Error" );

    }

    JOptionPane.showMessageDialog(null,"one book returned");

    }

    else

    {

    JOptionPane.showMessageDialog(null,"sorry book can't be

    returned");

    }

    }

    }

    }

  • 8/11/2019 Project Report Mukesh Paswan

    98/140

    catch(Exception e)

    {

    System.out.println("Error in return" );

    }

    setVisible(false);

    new AdminLogin();

    }

    if(evt.getSource().equals(b2))

    {

    setVisible(false);

    new AdminLogin();

    }

    }

    /*public static void main(String args[])

    {

    BookReturn br=new BookReturn();

    br.setDefaultCloseOperation(EXIT_ON_CLOSE);

    }*/

    }

    Update.java

    import java.awt.event.*;

    import java.awt.*;

    import javax.swing.*;

    import java.io.*;

    import java.sql.*;

    import java.lang.String;

  • 8/11/2019 Project Report Mukesh Paswan

    99/140

    public class Update extends JFrame implements ActionListener,

    FocusListener

    {

    Connection con=null;

    Statement stmt=null;

    ResultSet rs=null;

    JTextField t1,t2,t3,t4,t5,t6,t7,t8;

    JLabel l1,l2,l3,l4,l5,l6,l7,l8;

    JButton b1,b2;

    Panel p=new Panel();

    Panel p1=new Panel();

    Panel p2=new Panel();

    Container conn;

    ImageIcon bimg;

    Image icon=Toolkit.getDefaultToolkit().getImage("logo.gif");

    public Update()

    {

    super("Update BookStock");

    setIconImage(icon);

    conn=getContentPane();

    conn.setLayout(null);

    conn.setBackground(new Color(102,204,255));

    ImageIcon bimg=new ImageIcon("back.gif","Button image");

    b2=new JButton(bimg);

    p.setLayout(null);

    p.setBackground(new Color(102,204,255));

    p.setBounds(80,40,280,260);

  • 8/11/2019 Project Report Mukesh Paswan

    100/140

  • 8/11/2019 Project Report Mukesh Paswan

    101/140

    l7=new JLabel("Remarks");

    l7.setForeground(Color.magenta);

    t7=new JTextField(20);

    b1=new JButton("Updated");

    b1.setForeground(Color.blue);

    l1.setBounds(10,10,100,22);

    l2.setBounds(10,40,100,22);

    l3.setBounds(10,70,100,22);

    l4.setBounds(10,100,100,22);

    l5.setBounds(10,130,100,22);

    l6.setBounds(10,160,100,22);

    l7.setBounds(10,190,100,22);

    t1.setBounds(120,10,160,20);

    t2.setBounds(120,40,160,20);

    t3.setBounds(120,70,160,20);

    t4.setBounds(120,100,160,20);

    t5.setBounds(120,130,160,20);

    t6.setBounds(120,160,160,20);

    t7.setBounds(120,190,160,20);

    b1.setBounds(80,10,100,22);

    conn.add(p);

    conn.add(p1);

    conn.add(p2);

    p2.add(b2);

    p.add(l1);

    p.add(l2);

    p.add(l3);

  • 8/11/2019 Project Report Mukesh Paswan

    102/140

    p.add(l4);

    p.add(l5);

    p.add(l6);

    p.add(l7);

    p.add(t1);

    p.add(t2);

    p.add(t3);

    p.add(t4);

    p.add(t5);

    p.add(t6);

    p.add(t7);

    p1.add(b1);

    b1.addActionListener(this);

    b2.addActionListener(this);

    t1.addFocusListener(this);

    t5.addFocusListener(this);

    b1.setMnemonic('U');

    try

    {

    con=ConnectionOption.Connect();

    stmt=con.createStatement();

    }

    catch(Exception e)

    {

    System.out.println("Error in connection");

    }

    show();

  • 8/11/2019 Project Report Mukesh Paswan

    103/140

    t2.setEditable(false);

    t3.setEditable(false);

    t4.setEditable(false);

    t6.setEditable(false);

    t7.setEditable(false);

    }

    public void focusGained(FocusEvent e)

    {

    if(e.getSource().equals(t1))

    {

    if(t1.getText().length()>=0)

    { }

    }

    if(e.getSource().equals(t5))

    {

    try

    {

    con=ConnectionOption.Connect();

    stmt=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,R

    esultSet.CONCUR_UPDATABLE);

    rs=stmt.executeQuery("select * from

    bookdetails");

    boolean b1=false;

    while(rs.next() && b1==false)

    {

    if(t1.getText().equals(rs.getString(1)))

  • 8/11/2019 Project Report Mukesh Paswan

    104/140

    {

    int acc=rs.getInt(1);

    String title=rs.getString(2);

    String author=rs.getString(3);

    String year=rs.getString(4);

    String quan=rs.getString(5);

    int quant=rs.getInt(5);

    String issue=rs.getString(6);

    int issued=rs.getInt(6);

    String book=rs.getString(7);

    int bookl=quant - issued;

    String remark=rs.getString(8);

    t2.setText(""+title);

    t3.setText(""+author);

    t4.setText(""+year);

    t5.setText(""+quant);

    t6.setText(""+bookl);

    t7.setText(""+remark);

    }

    }

    }

    catch(Exception ex)

    {

    System.out.println("Error in connection");

    }

  • 8/11/2019 Project Report Mukesh Paswan

    105/140

    }

    }

    public void focusLost(FocusEvent e)

    {

    if(e.getSource().equals(t1))

    {

    t5.requestFocus();

    }

    }

    public void actionPerformed(ActionEvent evt)

    {

    if(evt.getSource().equals(b1))

    {

    try

    {

    con=ConnectionOption.Connect();

    stmt=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,R

    esultSet.CONCUR_UPDATABLE);

    rs=stmt.executeQuery("select * from

    bookdetails");

    boolean b1=false;

    while(rs.next() && b1==false)

    {

    if(t1.getText().equals(rs.getString(1)))

    {

    int acc=rs.getInt(1);

  • 8/11/2019 Project Report Mukesh Paswan

    106/140

    int a=Integer.parseInt(t5.getText());

    String sql="update bookdetails set

    quantity=(" + a + ") where accountnumber=('" + rs.getString(1) + "')";

    int status=stmt.executeUpdate(sql);

    if(status>0)

    {

    JOptionPane.showMessageDialog(null,"one item updated");

    }

    else

    {

    JOptionPane.showMessageDialog(null,"sorry record can't be

    updated");

    }

    }

    }

    }

    catch(Exception e)

    {

    System.out.println("Error in Updation" );

    }

    setVisible(false);

    new AdminLogin();

    }

    if(evt.getSource().equals(b2))

  • 8/11/2019 Project Report Mukesh Paswan

    107/140

    {

    setVisible(false);

    new AdminLogin();

    }

    }

    /*public static void main(String args[])

    {

    Update ud=new Update();

    ud.setDefaultCloseOperation(EXIT_ON_CLOSE);

    }*/

    }

    Delete.java

    import java.awt.event.*;

    import java.awt.*;

    import javax.swing.*;

    import java.io.*;

    import java.sql.*;

    import java.lang.String;

    public class Delete extends JFrame implements ActionListener,

    FocusListener

    {

    Connection con=null;

    Statement stmt=null;

    ResultSet rs=null;

    JTextField t1,t2,t3,t4,t5,t6,t7;

    JLabel l1,l2,l3,l4,l5,l6,l7;

  • 8/11/2019 Project Report Mukesh Paswan

    108/140

    JButton b1,b2;

    Panel p=new Panel();

    Panel p1=new Panel();

    Panel p2=new Panel();

    Container conn;

    ImageIcon bimg;

    Image icon=Toolkit.getDefaultToolkit().getImage("logo.gif");

    public Delete()

    {

    super("Delete Books");

    setIconImage(icon);

    conn=getContentPane();

    conn.setLayout(null);

    conn.setBackground(new Color(102,204,255));

    ImageIcon bimg=new ImageIcon("back.gif","Button image");

    b2=new JButton(bimg);

    p.setLayout(null);

    p.setBackground(new Color(102,204,255));

    p.setBounds(80,40,280,260);

    p1.setLayout(null);

    p1.setBackground(new Color(102,204,255));

    p1.setBounds(80,300,280,40);

    p2.setLayout(null);

    p2.setBackground(new Color(51,102,153));

    p2.setBounds(30,10,45,45);

    b2.setBounds(0,0,45,45);

    setLocation(200,300);

  • 8/11/2019 Project Report Mukesh Paswan

    109/140

    setSize(450,400);

    l1=new JLabel("ISBNNo.");

    l1.setForeground(Color.magenta);

    t1=new JTextField(20);

    l2=new JLabel("BookTitle");

    l2.setForeground(Color.magenta);

    t2=new JTextField(20);

    l3=new JLabel("Author");

    l3.setForeground(Color.magenta);

    t3=new JTextField(20);

    l4=new JLabel("Year");

    l4.setForeground(Color.magenta);

    t4=new JTextField(20);

    l5=new JLabel("Quantity");

    l5.setForeground(Color.magenta);

    t5=new JTextField(20);

    l6=new JLabel("Remarks");

    l6.setForeground(Color.magenta);

    t6=new JTextField(20);

    b1=new JButton("Item Deleted");

    b1.setForeground(Color.blue);

    l1.setBounds(10,10,100,22);

    l2.setBounds(10,40,100,22);

    l3.setBounds(10,70,100,22);

    l4.setBounds(10,100,100,22);

    l5.setBounds(10,130,100,22);

    l6.setBounds(10,160,100,22);

  • 8/11/2019 Project Report Mukesh Paswan

    110/140

    t1.setBounds(120,10,160,20);

    t2.setBounds(120,40,160,20);

    t3.setBounds(120,70,160,20);

    t4.setBounds(120,100,160,20);

    t5.setBounds(120,130,160,20);

    t6.setBounds(120,160,160,20);

    b1.setBounds(80,10,120,22);

    conn.add(p);

    conn.add(p1);

    conn.add(p2);

    p2.add(b2);

    p.add(l1);

    p.add(l2);

    p.add(l3);

    p.add(l4);

    p.add(l5);

    p.add(l6);

    p.add(t1);

    p.add(t2);

    p.add(t3);

    p.add(t4);

    p.add(t5);

    p.add(t6);

    p1.add(b1);

    b1.addActionListener(this);

    b2.addActionListener(this);

    t1.addFocusListener(this);

  • 8/11/2019 Project Report Mukesh Paswan

    111/140

    t5.addFocusListener(this);

    b1.setMnemonic('D');

    try

    {

    con=ConnectionOption.Connect();

    stmt=con.createStatement();

    }

    catch(Exception e)

    {

    System.out.println("Error in connection");

    }

    show();

    t2.setEditable(false);

    t3.setEditable(false);

    t4.setEditable(false);

    t5.setEditable(false);

    t6.setEditable(false);

    }

    public void focusGained(FocusEvent e)

    {

    if(e.getSource().equals(t1))

    {

    if(t1.getText().length()>=0)

    { }

    }

    if(e.getSource().equals(t5))

    {

  • 8/11/2019 Project Report Mukesh Paswan

    112/140

  • 8/11/2019 Project Report Mukesh Paswan

    113/140

    }

    }

    catch(Exception ex)

    {

    System.out.println("Error in connection");

    }

    }

    }

    public void focusLost(FocusEvent e)

    {

    if(e.getSource().equals(t1))

    {

    }

    }

    public void actionPerformed(ActionEvent evt)

    {

    if(evt.getSource().equals(b1))

    {

    try

    {

    con=ConnectionOption.Connect();

    stmt=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,R

    esultSet.CONCUR_UPDATABLE);

    rs=stmt.executeQuery("select * from

    bookdetails");

    boolean b1=false;

  • 8/11/2019 Project Report Mukesh Paswan

    114/140

    while(rs.next() && b1==false)

    {

    if(t1.getText().equals(rs.getString(1)))

    {

    String sql="delete from bookdetails where

    accountnumber=('" + rs.getString(1) + "')" ;

    int status=stmt.executeUpdate(sql);

    if(status>0)

    {

    JOptionPane.showMessageDialog(null,"one item deleted");

    }

    else

    {

    JOptionPane.showMessageDialog(null,"sorry record can't be

    deleted");

    }

    setVisible(false);

    new AdminLogin();

    }

    }

    }

    catch(Exception e)

    {

    System.out.println("Error in Deletion" );

    }

  • 8/11/2019 Project Report Mukesh Paswan

    115/140

    }

    if(evt.getSource().equals(b2))

    {

    setVisible(false);

    new AdminLogin();

    }

    }

    /*public static void main(String args[])

    {

    Delete dl=new Delete();

    dl.setDefaultCloseOperation(EXIT_ON_CLOSE);

    }*/

    }

    RReeppoorrtt..jjaavvaa

    import java.awt.event.*;

    import java.awt.*;

    import javax.swing.*;

    import java.io.*;

    import java.sql.*;

    import java.lang.String;

    public class Report extends JFrame implements ActionListener,ItemListener

    {

    Connection con=null;

    Statement stmt=null;

    ResultSet rs=null;

    JLabel l1=new JLabel("Details of Member");

  • 8/11/2019 Project Report Mukesh Paswan

    116/140

    JComboBox cb=new JComboBox();

    JLabel l2=new JLabel("Enter MemberId");

    JLabel l3=new JLabel("Enter MemberName");

    JLabel sl1=new JLabel("MemberId");

    JLabel sl2=new JLabel("Name");

    JLabel sl3=new JLabel("Address");

    JLabel sl4=new JLabel("PhoneNo.");

    JLabel sl5=new JLabel("EmailId");

    JLabel sl6=new JLabel("BookIssued");

    JLabel sl7=new JLabel("BookId");

    JButton b2=new JButton("Show");

    JButton b3=new JButton("Show");

    JTextField t1=new JTextField(40);

    JTextField t2=new JTextField(40);

    JTextField st1=new JTextField(40);

    JTextField st2=new JTextField(40);

    JTextField st3=new JTextField(40);

    JTextField st4=new JTextField(40);

    JTextField st5=new JTextField(40);

    JTextField st6=new JTextField(40);

    JTextField st7=new JTextField(40);

    JButton b1;

    JPanel p1,p2,p3,p5,p6;

    Container conn;

    ImageIcon bimg;

    Image icon=Toolkit.getDefaultToolkit().getImage("logo.gif");

    public Report()

  • 8/11/2019 Project Report Mukesh Paswan

    117/140

  • 8/11/2019 Project Report Mukesh Paswan

    118/140

    p5=new JPanel();

    p5.setLayout(null);

    p5.setBackground(new Color(51,102,153));

    p5.setBounds(30,10,45,45);

    b1.setBounds(0,0,45,45);

    conn.add(p1);

    p1.add(l1);

    p1.add(cb);

    conn.add(p2);

    conn.add(p3);

    conn.add(p5);

    conn.add(p6);

    p2.add(l2);

    p2.add(t1);

    p2.add(b2);

    p3.add(l3);

    p3.add(t2);

    p3.add(b3);

    p5.add(b1);

    l1.setForeground(Color.magenta);

    l2.setForeground(Color.magenta);

    l3.setForeground(Color.magenta);

    b2.setForeground(Color.blue);

    b3.setForeground(Color.blue);

    cb.setForeground(Color.blue);

    l1.setBounds(10,10,120,30);

    cb.setBounds(160,10,150,25);

  • 8/11/2019 Project Report Mukesh Paswan

    119/140

    l2.setBounds(10,10,120,30);

    t1.setBounds(160,10,150,25);

    b2.setBounds(110,50,100,25);

    l3.setBounds(10,10,120,30);

    t2.setBounds(160,10,150,25);

    b3.setBounds(110,50,100,25);

    sl1.setForeground(Color.magenta);

    sl2.setForeground(Color.magenta);

    sl3.setForeground(Color.magenta);

    sl4.setForeground(Color.magenta);

    sl5.setForeground(Color.magenta);

    sl6.setForeground(Color.magenta);

    sl7.setForeground(Color.magenta);

    sl1.setBounds(10,10,100,22);

    sl2.setBounds(10,40,100,22);

    sl3.setBounds(10,70,100,22);

    sl4.setBounds(10,100,100,22);

    sl5.setBounds(10,130,100,22);

    sl6.setBounds(10,160,100,22);

    sl7.setBounds(10,190,100,22);

    st1.setBounds(120,10,160,20);

    st2.setBounds(120,40,160,20);

    st3.setBounds(120,70,160,20);

    st4.setBounds(120,100,160,20);

    st5.setBounds(120,130,160,20);