100% found this document useful (1 vote)
531 views114 pages

Library

This document provides an overview of a project report for an Online Library Management System. It includes sections on system analysis of the existing manual system and proposed automated system, software requirements specification including hardware, software and development tools, and a high-level system design overview. The proposed system aims to automate library processes like member and book management, borrowing and returning books, and report generation to improve efficiency over the existing manual system.

Uploaded by

archielred
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
Download as doc, pdf, or txt
100% found this document useful (1 vote)
531 views114 pages

Library

This document provides an overview of a project report for an Online Library Management System. It includes sections on system analysis of the existing manual system and proposed automated system, software requirements specification including hardware, software and development tools, and a high-level system design overview. The proposed system aims to automate library processes like member and book management, borrowing and returning books, and report generation to improve efficiency over the existing manual system.

Uploaded by

archielred
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1/ 114

A

PROJECT REPORT ON

Submitted to Dr.B.R.Ambedkar University, Agra for the partial fulfillment of the Requirement for the Award of Degree for M.SC(Computer Science)

Done by Chiai Mohammed Haji Enrolment No:

INSTITUE OF INFORMATION & MANAGEMENT TECHNOLOGY ALIGARH 1

CERTIFICATE

This is to certify that Chiai Mohammed Haji, bearing Roll No. 111555330006 has developed Software project titled Online Library Management System as a partial fulfillment for award of Degree M.SC (Computer Science).

R.K Sharma

ACKNOWLEDGEMENT

My heartful gratitude and thanks to Almighty God, my parents and other family members and friends without whose unsustained support, I could not have made this project. I wish to place on my record my deep sense of gratitude to my project guide, MR. R.k Sharma for his constant motivation and valuable help through the project work. Express my gratitude to DIRECTOR NAME, Director of Institute of Information & Management Technology Aligarh for his valuable suggestions and advices throughout the course. I also extend my thanks to other faculties for their cooperation during my Course.

Finally I would like to thank my friends for their cooperation to complete this project.

Chiai Mohammed Haji

INDEX

1. Certificate 2. Acknowledgement 3. Introduction of project 4. System Analysis 5. Software Requirement Specification 6. System Design 7. Entity Relationship Diagram 8. Data Flow Diagram 9. Database Design 10. Modules 11. Coding 12.Testing 13. Conclusion 14.Bibliography

INTRODUCTION

The project titled Online Library Management System is Library management software for monitoring and controlling the transactions in a library .The project Online Library Management System is developed in java, which mainly focuses on basic operations in a library like adding new member, new books, and updating new information, searching books and members and facility to borrow and return books. Library Management System is a web application designed to help users maintain and organize library. Our software is easy to use for both beginners and advanced users. It features a familiar and well thought-out, an attractive user interface, combined with strong searching Insertion and reporting capabilities. The report generation facility of library system helps to get a good idea of which are the books borrowed by the members, makes users possible to generate reports hard copy. The software Library Management System has four main modules. Insertion and editing Database Module User friendly input screen Extracting from Database module Attractive Output Screen Report Generation module borrowed book list & Available book list Search Facility system search for books and members 5

SYSTEM ANALYSIS
EXISTING SYSTEM: System Analysis is a detailed study of the various operations performed by a system and their relationships within and outside of the system. Here the key question is- what all problems exist in the present system? What must be done to solve the problem? Analysis begins when a user or manager begins a study of the program using existing system. During analysis, data collected on the various files, decision points and transactions handled by the present system. The commonly used tools in the system are Data Flow Diagram, interviews, etc. Training, experience and common sense are required for collection of relevant information needed to develop the system. The success of the system depends largely on how clearly the problem is defined, thoroughly investigated and properly carried out through the choice of solution. A good analysis model should provide not only the mechanisms of problem understanding but also the frame work of the solution. Thus it should be studied thoroughly by collecting data about the system. Then the proposed system should be analyzed thoroughly in accordance with the needs. System analysis can be categorized into four parts. System planning and initial investigation Information Gathering 6

Applying analysis tools for structured analysis Feasibility study Cost/ Benefit analysis.

In our existing system all the transaction of books are done manually, So taking more time for a transaction like borrowing a book or returning a book and also for searching of members and books. Another major disadvantage is that to preparing the list of books borrowed and the available books in the library will take more time, currently it is doing as a one day process for verifying all records. So after conducting the feasibility study we decided to make the manual Library management system to be computerized. PROPOSED SYSTEM Proposed system is an automated Library Management System. Through our software user can add members, add books, search members, search books, update information, edit information, borrow and return books in quick time. Our proposed system has the following advantages. User friendly interface Fast access to database Less error More Storage Capacity 7

Search facility Look and Feel Environment Quick transaction All the manual difficulties in managing the Library have been rectified by implementing computerization. FEASIBILITY ANALYSIS Whatever we think need not be feasible .It is wise to think about the feasibility of any problem we undertake. Feasibility is the study of impact, which happens in the organization by the development of a system. The impact can be either positive or negative. When the positives nominate the negatives, then the system is considered feasible. Here the feasibility study can be performed in two ways such as technical feasibility and Economical Feasibility. Technical Feasibility: We can strongly says that it is technically feasible, since there will not be much difficulty in getting required resources for the development and maintaining the system as well. All the resources needed for the development of the software as well as the maintenance of the same is available in the organization here we are utilizing the resources which are available already.

Economical Feasibility Development of this application is highly economically feasible .The organization needed not spend much m one for the development of t he system already available. The only thing is to be done is making an environment for the development with an effective supervision. If we are doing so , we can attain the maximum usability of the corresponding resources .Even after the development , the organization will not be in a condition to invest more in t he organization .Therefore , the system is economically feasible.

SOFTWARE REQUIREMENTS SPECIFICATION


HARDWARE CONFIGURATION

Processor RAM Hard Disk Monitor Key Board

: : : : :

Pentium III 630MHz 128 MB 20GB 15 Color monitor 122 Keys

SOFTWARE CONFIGURATION Operating System Language Database Web Technologies Web Server : : : : : Windows 7, Windows XP. Java 2 Runtime Environment ORACLE 10G Servlet, JSP JBOSS SERVER 4.0.3 NetBeans 7.0

Development Environment:

10

Java: The java language contains built-in support for the World Wide Web(WWW), which is a service of the Internet to retrieve information in the form of Web pages. You can use Java to develop network-oriented programs because networking features are built-in features in Java. A few types of Java applications are: 1. Applications that use Character User Interface (CUI): Applications are executable programs that are controlled by the operation system. These applications have an access to the system resources, such as file systems and can read and write to files on local computers. 2. Applications that use Graphical User Interface(GUI): These applications are used in the Windows environment. In GUI, you interact with the application in graphical mode. 3. Applets: Applets are small executable programs that run on a Web page. These programs require a Java-enabled browser, such as Internet Explorer or Netscape Navigator. Applets have limited access to system resources. 4. Servlets: Servlets are the programs that are used to extend the functionality of Web servers. 5. Packages: Packages are collections of classes that can be reused by applications and applets. 11

JBOSS : JavaBeans Open Source Software Application Server (JBoss AS, or simply JBoss) is an application server that implements the Java Platform, Enterprise Edition (Java EE). JBoss is written in Java and as such is cross-platform: usable on any operating system that supports Java. JBoss was developed by JBoss, now a division of Red Hat. Licensed under the terms of the GNU Lesser General Public License, JBoss is free and open source software.

Sql: Structured Query Language (SQL) is a high-level language that is used to specify what information a user needs without having to know how to retrieve it. The database is responsible for developing the access path needed to retrieve the data. SQL works at a set level, meaning that it is designed to retrieve one or more rows. Essentially, it is used on one or more tables and returns the result as a results table. SQL has three categories based on the functionality involved:

DML - Data manipulation language used to read and modify data DDL - Data definition language used to define, change, or drop DB2 objects DCL - Data control language used to grant and revoke authorizations

12

Jsp: Java Server Pages (JSP) is a Java technology that allows software developers to dynamically generate HTML, XML or other types of documents in response to Web client request. The technology allows Java code and certain pre-defined actions to be embedded into static content. JSPs are compiled into Java Servlets by a JSP compiler. A JSP compiler may generate a servlet in Java code that is then compiled by the Java compiler, or it may generate byte code for the servlet directly. JSPs can also be interpreted on-the-fly reduction the time taken to reload changes.

13

SYSTEM DESIGN
INPUT DESIGN Input design is the process of converting user-oriented input to a computer based format. Input design is a part of overall system design, which requires very careful attention .Often the collection of input data is the most expensive part of the system. The main objectives of the input design are 1. Produce cost effective method of input 2. Achieve highest possible level of accuracy 3. Ensure that the input is acceptable to and understood by the staff. Input Data The goal of designing input data is to make enter easy, logical and free from errors as possible. The entering data entry operators need to know the allocated space for each field; field sequence and which must match with that in the source document. The format in which the data fields are entered should be given in the input form .Here data entry is online; it makes use of processor that accepts commands and data from the operator through a key board. The input required is analyzed by the processor. It is then accepted or rejected. Input stages include the following processes Data Recording Data Transcription Data Conversion Data Verification 14

Data Control Data Transmission Data Correction One of the aims of the system analyst must be to select data capture method and devices, which reduce the number of stages so as to reduce both the changes of errors and the cost .Input types, can be characterized as. External Internal Operational Computerized Interactive Input files can exist in document form before being input to the computer. Input design is rather complex since it involves procedures for capturing data as well as inputting it to the computer. OUTPUT DESIGN Outputs from computer systems are required primarily to communicate the results of processing to users. They are also used to provide a permanent copy of these result for latter consultation .Computer output is the most important and direct source of information to the users. Designing computer output should proceed in an organized well through out 15

the manner. The right output must be available for the people who find the system easy o use. The outputs have been defined during the logical design stage. If not, they should defined at the beginning of the output designing terms of types of output connect, format, response etc, Various types of outputs are External outputs Internal outputs Operational outputs Interactive outputs Turn around outputs All screens are informative and interactive in such a way that the user can full fill his requirements through asking queries. DATABASE DESIGN The general theme behind a database is to handle information as an integrated whole. A database is a collection of interrelated data stored with minimum redundancy to serve many users quickly and effectively. After designing input and output, the analyst must concentrate on database design or how data should be organized around user requirements. The general objective is to make information access, easy quick, inexpensive and flexible for other users. During database design the following objectives are concerned:16

Controlled Redundancy Data independence Accurate and integrating More information at low cost Recovery from failure Privacy and security Performance Ease of learning and use

17

ENTITY RELATIONSHIP DIAGRAM

18

DATA FLOW DIAGRAM

Context Diagram

19

1 Level DFD

20

2- Level DFD

21

TABLES
Table Name: Books Field Name BookId Authors Publisher Subject Price Purchasedate Status Data Type Number Varchar Varchar Varchar Number Date Char Width 10 25 25 25 10 1 Description Primary Key

Table Name: Issues Field Name BookId MemberID Issuedate Issuedby Table Name: Returns Field Name BookId MemberID Issuedate Issuedby Returndate Returnedto Table Name: Members Data Type Number Number Date Varchar Date Varchar Width 10 10 25 25 Data Type Number Number Date Varchar Width 10 10 25

22

Field Name MemberId Membername Address City State Pincode Phoneno email joindate depositamt Table Name: Users Field Name username password fullname

Data Type Number(10) Varchar(25) Varchar(50) Varchar(25) Varchar(25) Varchar(10) Varchar(10) Varchar(50) Date Number(10)

Description Primary Key -

Data Type Varchar Varchar Varchar

Width 25 25 25

23

MODULES OF PROJECT

The Library Management System automates the basic library functions to aid in the day-to-day operations of a library. It supports functions such as issue, return, the very basic functions of searching for a particular book, etc. It also maintains data about books about books, teachers, students records that are required during various library operations. The software aims to make the system user friendly and efficient. The functions that the Library Management System provides are as follows: 1. INSERT: This operation is performed when new data needs to be added to the system, for e.g. when department purchases a new book, the books entry is inserted in the books database. This option has three choices: a) Book: This choice allows entering data about newly purchased books into the books database. The data entered includes books author, title, publisher, cost and various other fields provided in the form. The data must be accurate and must be entered in the correct format as indicated in the forms. b) Member: This option is used for entering data for a new member in the members database.

24

2. DELETE: This operation clears the existing records in the various databases. It is used when for e.g. a member leaves college or when book is disposed of from library. But care must be taken while performing this operation and permission taken from the head of library because the system could lose any important data. It can be performed on all databases and on three choices are: a) Book: This will enter a null value for the book whose accession number is entered in the field provided in the respected form. This operation is done when a book is disposed of the library. b) Members: This will clear the record for a particular member whose identification number is entered. 3. UPDATE: This function updates data in the various records. This operation is supported by all the three entities : a) Book: This function generally would not be required for updating a books status as that data wouldnt change. b) Members : This will update the data of particular member, whose data has changed like address, phone number, etc. by entering her identification number. . 4. SEARCH: This function is used to search particular data from the database. This function can search for data related to all the three entities: a) Book: To search for a particular book, to know whether it is currently available in library or not. This can be done by 25

entering value in any one or more fields in the form to perform the search such as title or author name. b) Member : This will find out the particular who currently has the book for which search is being carried out. 5. ISSUE: This operation is used for issuing a book to a member of the library. For this operation to be successful the member must meet some criteria like she should not have issued books to her maximum limit previously. All these checks are done by software. If the operation is successful, then the system automatically stores the date of issue and the due date by which the book must be returned. 6. RETURN: Using this operation a member returns the items, which he/she loaned, from the library back to it. If the book, which is loaned is not returned within specified time the member ends up as a defaulter and she is required to pay fine which is calculated automatically by the software. 7. LOGOUT: This takes user out of the application.

26

CODING
Index.jsp <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Login Page</title> <link href="styles.css" rel="stylesheet"/> </head> <body> <center> <h1>Library Management</h1> <h3>Login</h3> <form action="index.jsp" method="post"> <table > <tbody> <tr> <td>Login Name</td> <td><input type="text" name="lname" value="" width="150px" /></td> </tr> <tr> <td>Password</td> <td><input /></td> </tr> </tbody> 27 type="password" name="pwd" value="" width="150px"

</table> <input type="submit" value="Login"/> </form> <jsp:useBean id="user" scope="session" class="lm.UserBean" /> <jsp:setProperty name="user" property="*"/> <% if ( request.getParameter("lname") == null) return; if ( user.login()) response.sendRedirect("home.jsp"); else out.println("Invalid Login! Please Try Again!"); %> </center> </body> </html> Home.jsp <%@page contentType="text/html"%> <%@page pageEncoding="UTF-8"%> <html> <head> <link rel="stylesheet" href="styles.css"/> <style> a { color:white; text-decoration: none ; font-size: 12pt;padding-left: 20px;} a:hover { text-decoration: underline; } 28

</style> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Home Page</title> </head> <body> <center> <h1>Library Management</h1> </center> <table border="0" width="100%" height="100%" > <tbody> <tr> <td bgcolor="navy" width="25%" valign="top"> <br/> <br/> <a href="books.jsp">Books</a> <br/> <br/> <a href="members.jsp">Members</a> <br/> <br/> <a href="issuebook.jsp">Issue</a> <br/> <br/> <a href="returnbook.jsp">Return</a> <br/> <br/> <a href="searchbook.jsp">Search Book</a> 29

<br/> <br/> <a href="searchmember.jsp">Search Member</a> <br/> <br/> <a href="logout.jsp">Logout</a> <br/> </td> <td valign="top"> <jsp:useBean id="user" scope="session" class="lm.UserBean" /> <h4>Welcome ${user.fullname} </h4> </td> </tr> </tbody> </table> </body> </html> Addbook.jsp <%@page contentType="text/html"%> <%@page pageEncoding="UTF-8"%> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Add Book</title> <link rel="stylesheet" href="styles.css"/> <style> a { color:white; text-decoration: none ; font-size: 12pt;padding-left: 20px;} 30

a:hover { text-decoration: underline; </style> </head> <body>

<jsp:useBean id="book" scope="page" class="lm.BookBean" /> <jsp:setProperty name="book" property="*"/><center> <h1>Library Management</h1> </center> <table cellpadding=5 border=1 width="100%"> <tr> <td bgcolor="navy" style="color:white"> <br/> <br/> <a href="editbook.jsp">Add Book</a> <br/> <br/> <a href="deletebook">Delete Book</a> <br/> <a href="searchbook.jsp">Search Book</a> <br/> <br/> <a href="logout.jsp">Logout</a> <br/> <br/> </td> <td> <% 31

int bid = book.addBook(); if ( bid == -1) out.println("Sorry! Book could not be added!"); else out.println("Book was added successfully. Book ID = " + bid ); %> <br/><br/> <br/><br/> <a style="color:black;text-decoration: underline" href="javascript:history.back()">Back</a> <a style="color:black;text-decoration: underline" href="home.jsp">Home Page</a> </td> </tr> </table> </body> </html> Addmember.jsp <%@page contentType="text/html"%> <%@page pageEncoding="UTF-8"%> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Add Member</title> <link rel="stylesheet" href="styles.css"/> <style> a { color:white; text-decoration: none ; font-size: 12pt;padding-left: 20px;} 32

a:hover { text-decoration: underline; </style> </head> <body>

<jsp:useBean id="member" scope="page" class="lm.MemberBean" /> <jsp:setProperty name="member" property="*"/> <center> <h1>Library Management</h1> </center> <table border="0" width="100%" height="100%" > <tbody> <tr> <td bgcolor="navy" width="25%" valign="top"> <br/> <a href="addmember.html">Add Member</a> <br/> <br/> <a href="editmember.jsp">Edit Member</a> <br/> <a href="deletemember.jsp">Delete Member</a> <br/> <br/> <a href="searchmember.jsp">Search Member</a> <br/> <br/> <a href="logout.jsp">Logout</a> <br/> 33

</td> <td valign="top"> <% int mid = member.addMember(); if ( mid == -1) out.println("Sorry! Member could not be added!"); else out.println("Member was added successfully. Member ID = " + mid ); %> <br/><br/><br/><br/> <a style="color:black;text-decoration: underline" href="javascript:history.back()">Back</a> <a style="color:black;text-decoration: underline" href="home.jsp">Home Page</a> </td> </tr> </table> </body> </html> bookinfo.jsp <%@page contentType="text/html"%> <%@page pageEncoding="UTF-8"%> <%@page import="java.sql.*"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> 34

<head> <link rel="stylesheet" href="styles.css"/> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Book Information</title> <style> a { color:white; text-decoration: none ; font-size: 12pt;padding-left: 20px;} a:hover { text-decoration: underline; </style> </head> <body> <center> <h1>Library Management</h1> </center> <table cellpadding=5 border=1 width="100%"> <tr> <td bgcolor="navy" style="color:white"> <br/> <br/> <a href="editbook.jsp">Add Book</a> <br/> <br/> <a href="deletebook.jsp">Delete Book</a> <br/> <br/> <a href="searchbook.jsp">Search Book</a> <br/> <br/> 35 }

<a href="logout.jsp">Logout</a> </td> <td valign="top"> <h2>Book Information</h2> <% String bid = request.getParameter("bid"); Connection con = lm.Database.getConnection(); Statement st = con.createStatement(); ResultSet rs = st.executeQuery("select * from books where bid = " + bid); if (! rs.next()) { out.println("<h4>Sorry! Book Not Found!</h4>"); out.println("<p/> <a href='javascript:history.back()'>Back</a>"); } %> <table border="1" cellspacing="2" width="100%"> <thead> <tr> <td>Book ID </td> <td><%=rs.getString("bid")%></td> </tr> <tr> <td>Book Name </td> <td><%=rs.getString("name")%></td> </tr> <tr> <td>Author</td> 36

<td><%=rs.getString("authors")%></td> </tr> <tr> <td>Publisher </td> <td><%=rs.getString("publisher")%></td> </tr> <tr> <td>Subject</td> <td><%=rs.getString("subject")%></td> </tr> </table> <% rs.close(); st.close(); con.close(); %> <p> <a style="color:black;text-decoration: underline" href="javascript:history.back()">Back</a> <a style="color:black;text-decoration: underline" href="home.jsp">Home Page</a> </td> </tr></table> </body> </html> Deletebook.jsp <%@page contentType="text/html"%> 37

<%@page pageEncoding="UTF-8"%> <%@page import="java.sql.*"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <link rel="stylesheet" href="styles.css"/> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Edit Books</title> <style> a {color:white; text-decoration: none ; font-size: 12pt;padding-left: 20px;} a:hover { text-decoration: underline; } </style> </head> <body> <center> <h1>Library Management</h1> </center> <form action="deletebook.jsp" method="post"> <table border="0" width="100%" height="100%" > <tbody> <tr> <td bgcolor="navy" width="25%" valign="top"> <a href="editbook.jsp">Edit Book</a> <a href="deletebook">Delete Book</a> 38

<a href="searchbook.jsp">Search Book</a> <a href="logout.jsp">Logout</a> </td> <td valign="top"> <h2>Edit Books</h2> <form action="editbook.jsp"> <table border="0"> <tbody> <tr> <td>Title Contains</td> <td><input type="text" name="title" value="" /></td> </tr> <tr> <td>Author Name </td> <td><input type="text" name="author" value="" /></td> </tr> <tr> <td>Subject</td> <td><select name="subject" width="200px"> <option value="all">All</option> <option value="java">Java Language</option> <option value="dnet">.NET</option> <option value="c">C Language</option> <option value="ora">Oracle</option> <option value="others">Others</option> </select></td> </tr> 39

<tr> <td colspan=2><input type="radio" name="status" value="a" checked />Available Books <input type="radio" name="status" value="i" />Issued Books <input type="radio" name="status" value="all" />All Books</td> </tr> </table> <input type="submit" value="Search" /> <input type="button" value="Cancel" onclick="javascript:document.URL='home.jsp'" /> </form> <% if ( request.getParameter("title") == null ) return; String cond=" 1 = 1 "; String title = request.getParameter("title"); if ( title.length() > 0) cond += " and upper(name) like '%" + title.toUpperCase() + "%'"; String author = request.getParameter("author"); if ( author.length() > 0) cond += " and upper(authors) like '%" + author.toUpperCase() + "%'"; String subject = request.getParameter("subject"); if ( ! subject.equals("all")) cond += " and upper(subject) = '" + subject.toUpperCase() + "'"; String status = request.getParameter("status"); if ( status.equals("a")) cond += " and status = 'a'"; else 40

if ( status.equals("i")) cond += " and status = 'i'"; Connection con = lm.Database.getConnection(); Statement st = con.createStatement(); ResultSet rs = st.executeQuery("select * from books where " + cond); %> <table border="1" cellspacing="2" width="100%"> <thead> <tr> <th>Subject</th> <th>Book Name</th> <th>Authors</th> <th>Publisher</th> <th>Purchased On</th> <th>Price</th> <th>Status</th> <th>&nbsp;</th> </tr> </thead> <% while ( rs.next()) { %> <tr> <td><%=rs.getString("subject")%></td> <td><%=rs.getString("name")%></td> <td><%=rs.getString("authors")%></td> 41

<td><%=rs.getString("publisher")%></td> <td><%=rs.getString("dp")%></td> <td><%=rs.getString("price")%></td> <td><%=rs.getString("status")%></td> <td> <% out.println("<a style='color:black;text-decoration: underline' href=deletebookaction.jsp?bid=" + rs.getString("bid") + ">Delete</a>"); %> </td> </tr> <% } rs.close(); st.close(); con.close(); %> </table> </td> </table> </body> </html> Deletebookaction.jsp <%@page contentType="text/html" pageEncoding="UTF-8" import="java.sql.*" session="true" %> <!DOCTYPE html> <html> <head> 42

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title><link rel="stylesheet" href="styles.css"/> <style> a { color:white; text-decoration: none ; font-size: 12pt;padding-left: 20px;} a:hover { text-decoration: underline; </style> </head> <body> <center> <h1>Library Management</h1> </center> <table cellpadding=5 border=1 width="100%"> <tr> <td bgcolor="navy" style="color:white"> <a href="editbook.jsp">Edit Book</a> <a href="deletebook">Delete Book</a> <a href="searchbook.jsp">Search Book</a> <a href="logout.jsp">Logout</a> </td> <td valign="top"> <% String bid= request.getParameter("bid"); try { Connection con = lm.Database.getConnection(); Statement st = con.createStatement(); 43 }

ResultSet rs = st.executeQuery("select * from books where bid= " + bid ); rs.next(); String status=rs.getString("status"); if(status.equalsIgnoreCase("i")) { out.println("<h2>Book is issued so cannot be Deleted</h2>" ); return; } PreparedStatement ps; ps = con.prepareStatement("delete from books where bid=?"); ps.setInt(1,Integer.parseInt(bid)); ps.executeUpdate(); out.println("<h2>Book was deletede successfully </h2>" ); } catch(Exception ex) { out.print(ex.getMessage()); } %> <a style="color:black;text-decoration: underline" href="javascript:history.back()">Back</a> <a style="color:black;text-decoration: underline" href="home.jsp">Home Page</a> </td> </tr> </table> </body> 44

</html>

45

Deletemember.jsp <%@page contentType="text/html"%> <%@page pageEncoding="UTF-8"%> <%@page import="java.sql.*"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <link rel="stylesheet" href="styles.css"/> <title>Delete Members</title> <style> a { color:white; text-decoration: none ; font-size: 12pt;padding-left: 20px;} a:hover { text-decoration: underline; } </style> </head> <body> <center> <h1>Library Management</h1> </center> <table border="0" width="100%" height="100%" > <tbody> <tr> <td bgcolor="navy" width="25%" valign="top"> <a href="addmember.html">Add Member</a> <br/> 46

<br/> <a href="editmember.jsp">Edit Member</a> <a href="deletebook">Delete Member</a> <a href="searchmember.jsp">Search Member</a> <a href="logout.jsp">Logout</a> <h2>Delete Members</h2> <form action="deletemember.jsp"> <table border="0"> <tbody> <tr> <td>Member Name</td> <td><input type="text" name="mname" value="" /></td> </tbody> </table> <input type="submit" value="Search" /> <input type="button" value="Cancel" onclick="javascript:document.URL='home.jsp'" /> </form> <% if ( request.getParameter("mname") == null ) return; String cond=" 1 = 1 "; String mname = request.getParameter("mname"); if ( mname.length() > 0) cond += " and upper(name) like '%" + mname.toUpperCase() + "%'"; Connection con = lm.Database.getConnection(); Statement st = con.createStatement(); 47

ResultSet rs = st.executeQuery("select * from members where " + cond); %> <table border="1" cellspacing="2" width="100%"> <tr> <th>Member ID</th> <th>Member Name</th> <th>Address</th> <th>city</th> <th>State</th> <th>Phone No</th> <th>Email Id</th> <th>Membership Date</th> <th>Amount Deposited</th> <th>Edit</th> </tr> </thead> <% while ( rs.next()) { %> <tr> <td><%=rs.getInt("mid")%></td> <td><%=rs.getString("name")%></td> <td><%=rs.getString("address")%></td> <td><%=rs.getString("city")%></td> <td><%=rs.getString("state")%></td> <td><%=rs.getString("phoneno")%></td> 48

<td><%=rs.getString("email")%></td> <td><%=rs.getString("djoin")%></td> <td><%=rs.getInt("depamt")%></td> <td><% out.println("<a style='color:black;text-decoration: underline' href=deletememberaction.jsp?mid=" + rs.getString("mid") + ">Delete</a>"); %></td> </tr> <% } rs.close(); st.close(); con.close(); %> </table> </td> </table> </body> </html> Deletememberaction.jsp <%@page contentType="text/html" pageEncoding="UTF-8" import="java.sql.*" session="true" %> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> 49

<link rel="stylesheet" href="styles.css"/> <style> a { color:white; text-decoration: none ; font-size: 12pt;padding-left: 20px;} a:hover { text-decoration: underline; </style> </head> <body> <center> <h1>Library Management</h1> </center> <table cellpadding=5 border=1 width="100%"> <tr> <td bgcolor="navy" style="color:white"> <a href="editbook.jsp">Edit Book</a> <a href="deletebook">Delete Book</a> <a href="searchbook.jsp">Search Book</a> <a href="logout.jsp">Logout</a> <% String mid= request.getParameter("mid"); try { Connection con = lm.Database.getConnection(); Statement st = con.createStatement(); ResultSet rs = st.executeQuery("select * from issues where mid= " + mid ); if(rs.next()) { out.println("<h2>Member has Book so cannot be Deleted</h2>" ); 50 }

return; } PreparedStatement ps; ps = con.prepareStatement("delete from members where mid=?"); ps.setInt(1,Integer.parseInt(mid)); ps.executeUpdate(); out.println("<h2>Member was deleted successfully </h2>" ); } catch(Exception ex) { out.print(ex.getMessage()); } %> <a style="color:black;text-decoration: underline" href="javascript:history.back()">Back</a> <a style="color:black;text-decoration: underline" href="home.jsp">Home Page</a> </td> </tr> </table> </body> </html> Editbook.jsp <%@page contentType="text/html"%> <%@page pageEncoding="UTF-8"%> <%@page import="java.sql.*"%> 51

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <link rel="stylesheet" href="styles.css"/> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Edit Books</title> <style> a {color:white; text-decoration: none ; font-size: 12pt;padding-left: 20px;} a:hover { text-decoration: underline; } </style> </head> <body> <center> <h1>Library Management</h1> </center> <form action="editbook.jsp" method="post"> <table border="0" width="100%" height="100%" > <tbody> <tr> <td bgcolor="navy" width="25%" valign="top"> <br/> <br/> <a href="editbook.jsp">Edit Book</a> <br/> 52

<br/> <a href="deletebook">Delete Book</a> <a href="searchbook.jsp">Search Book</a> <a href="logout.jsp">Logout</a> </td> <td valign="top"> <h2>Edit Books</h2> <form action="editbook.jsp"> <table border="0"> <tbody> <tr> <td>Title Contains</td> <td><input type="text" name="title" value="" /></td> </tr> <tr> <td>Author Name </td> <td><input type="text" name="author" value="" /></td> </tr> <tr> <td>Subject</td> <td><select name="subject" width="200px"> <option value="all">All</option> <option value="java">Java Language</option> <option value="dnet">.NET</option> <option value="c">C Language</option> <option value="ora">Oracle</option> <option value="others">Others</option> 53

</select></td> </tr> <tr> <td colspan=2><input type="radio" name="status" value="a" checked />Available Books <input type="radio" name="status" value="i" />Issued Books <input type="radio" name="status" value="all" />All Books</td> </tr> </tbody> <input type="submit" value="Search" /> <input type="button" value="Cancel" onclick="javascript:document.URL='home.jsp'" /> </form> <% if ( request.getParameter("title") == null ) return; String cond=" 1 = 1 "; String title = request.getParameter("title"); if ( title.length() > 0) cond += " and upper(name) like '%" + title.toUpperCase() + "%'"; String author = request.getParameter("author"); if ( author.length() > 0) cond += " and upper(authors) like '%" + author.toUpperCase() + "%'"; String subject = request.getParameter("subject"); if ( ! subject.equals("all")) cond += " and upper(subject) = '" + subject.toUpperCase() + "'"; String status = request.getParameter("status"); if ( status.equals("a")) 54

cond += " and status = 'a'"; else if ( status.equals("i")) cond += " and status = 'i'"; Connection con = lm.Database.getConnection(); Statement st = con.createStatement(); ResultSet rs = st.executeQuery("select * from books where " + cond); %> <table border="1" cellspacing="2" width="100%"> <thead> <tr> <th>Subject</th> <th>Book Name</th> <th>Authors</th> <th>Publisher</th> <th>Purchased On</th> <th>Price</th> <th>Status</th> <th>&nbsp;</th> </tr> </thead> <% while ( rs.next()) { %> <tr> <td><%=rs.getString("subject")%></td> 55

<td><%=rs.getString("name")%></td> <td><%=rs.getString("authors")%></td> <td><%=rs.getString("publisher")%></td> <td><%=rs.getString("dp")%></td> <td><%=rs.getString("price")%></td> <td><%=rs.getString("status")%></td> <td> <% out.println("<a style='color:black;text-decoration: underline' href=editbookaction.jsp?bid=" + rs.getString("bid") + ">Edit</a>"); %> </td> </tr> <% } rs.close(); st.close(); con.close(); %> </table> </td> </table> </body> </html> Editbookaction.jsp <%@page contentType="text/html" pageEncoding="UTF-8" import="java.sql.*" session="true" %> <!DOCTYPE html> <html> 56

<head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body> <% String bid = request.getParameter("bid"); session.setAttribute("bid", bid); Connection con = lm.Database.getConnection(); Statement st = con.createStatement(); ResultSet rs = st.executeQuery("select * from books where bid= " + bid ); rs.next(); %> <center> <h1>Library Management</h1> </center> <form action="updatebook.jsp" method="post"> <table border="0" width="100%" height="100%" > <tbody> <tr> <td bgcolor="navy" width="25%" valign="top"> <a href="editbook.jsp">Edit Book</a> <a href="deletebook">Delete Book</a> <a href="searchbook.jsp">Search Book</a> <a href="logout.jsp">Logout</a> <br/> <br/> 57

</td> <td valign="top"> <h2>Edit Book</h2> <table> <tr> <td>Book Name </td> <td><input type="text" name="bname" value="<%=rs.getString("name") %>" width="200px" /></td> </tr> <tr> <td>Authors</td> <td><input type="text" name="authors" value="<%=rs.getString("authors") %>" width="200px" /></td> </tr> <tr> <td>Publisher</td> <td><input type="text" name="publisher" value="< %=rs.getString("publisher") %>" width="200px" /></td> </tr> <tr> <td>Subject</td> <td><input type="text" name="subject" value="<%=rs.getString("subject") %>" width="200px" /></td> </tr> <tr> <td>Price</td> 58

<td><input type="text" name="price" value="<%=rs.getInt("price") %>" width="200px" /></td>" size="5" /></td> </tr> <tr> <td>Date of purchase</td> <td><input type="text" name="dp" value="<%=rs.getString("dp") %>" width="200px" /></td>" size="8" /> (dd-mon-yy)</td> </tr> <tr> <td> <input type="submit" value="Edit Book" /></td> <td><input type="button" value="Cancel" onclick="javascript:history.back()"/></td> </table> </table> </body> </html> Editmember.jsp <%@page contentType="text/html"%> <%@page pageEncoding="UTF-8"%> <%@page import="java.sql.*"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <link rel="stylesheet" href="styles.css"/> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Edit Members</title> 59

<style> a { color:white; text-decoration: none ; font-size: 12pt;padding-left: 20px;} a:hover { text-decoration: underline; } </style> </head> <body> <center> <h1>Library Management</h1> </center> <table border="0" width="100%" height="100%" > <tbody> <tr> <td bgcolor="navy" width="25%" valign="top"> <a href="addmember.html">Add Member</a> <a href="editmember.jsp">Edit Member</a> <a href="deletebook">Delete Member</a> <br/> <br/> <a href="searchmember.jsp">Search Member</a> <br/> <br/> <a href="logout.jsp">Logout</a> <br/> </td> <td valign="top"> 60

<h2>Edit Members</h2> <form action="editmember.jsp"> <table border="0"> <tbody> <tr> < td>Member Name</td> <td><input type="text" name="mname" value="" /></td> </tr> </tbody> </table> <input type="submit" value="Search" /> <input type="button" value="Cancel" onclick="javascript:document.URL='home.jsp'" /> </form> <% if ( request.getParameter("mname") == null ) return; String cond=" 1 = 1 "; String mname = request.getParameter("mname"); if ( mname.length() > 0) cond += " and upper(name) like '%" + mname.toUpperCase() + "%'"; Connection con = lm.Database.getConnection(); Statement st = con.createStatement(); ResultSet rs = st.executeQuery("select * from members where " + cond); %> <table border="1" cellspacing="2" width="100%"> 61

<thead> <tr> <th>Member ID</th> <th>Member Name</th> <th>Address</th> <th>city</th> <th>State</th> <th>Phone No</th> <th>Email Id</th> <th>Membership Date</th> <th>Amount Deposited</th> <th>Edit</th> </tr> </thead> <% while ( rs.next()) { %> <tr> <td><%=rs.getInt("mid")%></td> <td><%=rs.getString("name")%></td> <td><%=rs.getString("address")%></td> <td><%=rs.getString("city")%></td> <td><%=rs.getString("state")%></td> <td><%=rs.getString("phoneno")%></td> <td><%=rs.getString("email")%></td> <td><%=rs.getString("djoin")%></td> 62

<td><%=rs.getInt("depamt")%></td> <td><% out.println("<a style='color:black;text-decoration: underline' href=editmemberaction.jsp?mid=" + rs.getString("mid") + ">Edit</a>"); %></td> </tr> <% } rs.close(); st.close(); con.close(); %> </table> </td> </table> </body> </html> Editmemberaction.jsp <%@page contentType="text/html" pageEncoding="UTF-8" import="java.sql.*" session="true" %> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> <link rel="stylesheet" href="styles.css"/> <style> 63

a { color:white; text-decoration: none ; font-size: 12pt;padding-left: 20px;} a:hover { text-decoration: underline; } </style> </head> <body> <% String mid = request.getParameter("mid"); session.setAttribute("mid", mid); Connection con = lm.Database.getConnection(); Statement st = con.createStatement(); ResultSet rs = st.executeQuery("select * from members where mid= " + mid ); rs.next(); %> <center> <h1>Library Management</h1> </center> <form action="updatemember.jsp" method="post"> <table border="0" width="100%" height="100%" > <tbody> <tr> <td bgcolor="navy" width="25%" valign="top"> <br/> 64

<br/> <a href="addmember.html">Add Member</a> <br/> <br/> <a href="editmember.jsp">Edit Member</a> <br/> <br/> <a href="deletemember.jsp">Delete Member</a> <br/> <br/> <a href="searchmember.jsp">Search Member</a> <br/> <br/> <a href="logout.jsp">Logout</a> <br/> </td> <td valign="top"> <h2>Add Member</h2> <form action="addmember.jsp" method="post"> <table> <tr> <td>Member Name</td> <td><input type="text" name="mname" value="< %=rs.getString("name") </tr> <tr> <td>Address</td> 65 %>" width="200px" /></td>

<td><input type="text" name="address" value="< %=rs.getString("address") %>" width="200px" /></td> </tr> <tr> <td>City</td> <td><input type="text" name="city" value="<%=rs.getString("city") %>" width="200px" /></td> </tr> <tr> <td>State</td> <td><input type="text" name="state" value="<%=rs.getString("state") %>" width="200px" /></td> </tr> <tr> <td>Pincode</td> <td><input type="text" name="pin" value="<%=rs.getString("pincode") %>" size="10" /></td> </tr> <tr> <td>Phone No</td> <td><input type="text" name="ph" value="<%=rs.getString("phoneno") %>" size="10" /> </td> </tr> <tr> <td>Email ID</td> <td><input type="text" name="email" value="<%=rs.getString("email") %>" size="30" /> </td> 66

</tr> <tr> <td>Membership Date</td> <td><input type="text" name="doj" value="<%=rs.getString("djoin") %>" size="10" /> </td> </tr> <tr> <td>Deposited Money</td> <td><input type="text" name="amt" value="<%=rs.getInt("depamt") %>" size="10" /> </td> </tr> <tr> <td> <input type="submit" value="Edit Member" /></td> <td><input type="button" value="Cancel" onclick="javascript:history.back()"/></td> </table> </td> </table> </form> </body> </html>

67

Issue.jsp <%@page contentType="text/html"%> <%@page pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Issue Of Book</title> <link rel="stylesheet" href="styles.css"/> <style> a { color:white; text-decoration: none ; font-size: 12pt;padding-left: 20px;} a:hover { text-decoration: underline; } </style> </head> <body> <jsp:useBean id="user" scope="session" class="lm.UserBean" /> <jsp:useBean id="trans" scope="page" class="lm.TransactionBean" /> <center> <h1>Library Management</h1> </center> <table border="0" width="100%" height="100%" > <tbody> <tr> 68

<td bgcolor="navy" width="25%" valign="top"> <br/> <br/> <a href="books.jsp">Books</a> <br/> <br/> <a href="members.jsp">Members</a> <br/> <br/> <a href="issuebook.jsp">Issue</a> <br/> <br/> <a href="returnbook.jsp">Return</a> <br/> <br/> <a href="searchbook.jsp">Search Book</a> <br/> <br/> <a href="searchmember.jsp">Search Member</a> <br/> <br/> <a href="logout.jsp">Logout</a> <br/> </td> <td valign="top"> <br/> <br/> 69

<br/> <br/> <% String bid = request.getParameter("bid"); String mid = request.getParameter("mid"); if ( trans.issueBook(bid,mid, user.getLname())) out.println("<h2>Book Issue Is Successful!</h2>"); else out.println("<h2>Book Issue Has Failed!</h2>"); %> <br/> <br/> <br/> <a style="color:black;text-decoration: underline" href="home.jsp">Home Page</a> &nbsp; <a style="color:black;text-decoration: underline" href="javascript:history.back()">Back</a> </td> </tr> </table> </body> </html> Return.jsp <%@page contentType="text/html"%> <%@page pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 70

"http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Return Of Book</title> <link rel="stylesheet" href="styles.css"/> <style> a { color:white; text-decoration: none ; font-size: 12pt;padding-left: 20px;} a:hover { text-decoration: underline; } </style> </head> <body> <jsp:useBean id="user" scope="session" class="lm.UserBean" /> <jsp:useBean id="trans" scope="page" class="lm.TransactionBean" /> <center> <h1>Library Management</h1> </center> <table border="0" width="100%" height="100%" > <tbody> <tr> <td bgcolor="navy" width="25%" valign="top"> <br/> <br/> <a href="books.jsp">Books</a> <br/> 71

<br/> <a href="members.jsp">Members</a> <br/> <br/> <a href="issuebook.jsp">Issue</a> <br/> <br/> <a href="returnbook.jsp">Return</a> <br/> <br/> <a href="searchbook.jsp">Search Book</a> <br/> <br/> <a href="searchmember.jsp">Search Member</a> <br/> <br/> <a href="logout.jsp">Logout</a> <br/> </td> <td valign="top"> <br/> <br/> <br/> <br/> <% String bid = request.getParameter("bid"); if ( trans.returnBook(bid,user.getLname())) 72

out.println("<h2>Book Return Is Successful!</h2>"); else out.println("Book Return Has Failed!</h2>"); %> <br/> <br/> <br/> <br/> <a style="color:black;text-decoration: underline" href="home.jsp">Home Page</a> &nbsp; <a style="color:black;text-decoration: underline" href="javascript:history.back()">Back</a> </td> </tr> </table> </body> </html> Searchbook.jsp <%@page contentType="text/html"%> <%@page pageEncoding="UTF-8"%> <%@page import="java.sql.*"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <link rel="stylesheet" href="styles.css"/> 73

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Search For Books</title> <style> a { color:white; text-decoration: none ; font-size: 12pt;padding-left: 20px;} a:hover { text-decoration: underline; } </style> </head> <body> <center> <h1>Library Management</h1> </center> <table border="0" width="100%" height="100%" > <tbody> <tr> <td bgcolor="navy" width="25%" valign="top"> <br/> <br/> <a href="editbook.jsp">Edit Book</a> <br/> <br/> <a href="deletebook">Delete Book</a> <br/> <br/> <a href="searchbook.jsp">Search Book</a> <br/> 74

<br/> <a href="logout.jsp">Logout</a> <br/> <br/> </td> <td valign="top"> <h2>Search For Books</h2> <form action="searchbook.jsp"> <table border="0"> <tbody> <tr> <td>Title Contains</td> <td><input type="text" name="title" value="" /></td> </tr> <tr> <td>Author Name </td> <td><input type="text" name="author" value="" /></td> </tr> <tr> <td>Subject</td> <td><select name="subject" width="200px"> <option value="all">All</option> <option value="java">Java Language</option> <option value="dnet">.NET</option> <option value="c">C Language</option> <option value="ora">Oracle</option> <option value="others">Others</option> 75

</select></td> </tr> <tr> <td colspan=2><input type="radio" name="status" value="a" checked />Available Books <input type="radio" name="status" value="i" />Issued Books <input type="radio" name="status" value="all" />All Books</td> </tr> </tbody> </table> <input type="submit" value="Search" /> <input type="button" value="Cancel" onclick="javascript:document.URL='home.jsp'" /> </form> <% if ( request.getParameter("title") == null ) return; String cond=" 1 = 1 "; String title = request.getParameter("title"); if ( title.length() > 0) cond += " and upper(name) like '%" + title.toUpperCase() + "%'"; String author = request.getParameter("author"); if ( author.length() > 0) cond += " and upper(authors) like '%" + author.toUpperCase() + "%'"; String subject = request.getParameter("subject"); if ( ! subject.equals("all")) cond += " and upper(subject) = '" + subject.toUpperCase() + "'"; 76

String status = request.getParameter("status"); if ( status.equals("a")) cond += " and status = 'a'"; else if ( status.equals("i")) cond += " and status = 'i'"; Connection con = lm.Database.getConnection(); Statement st = con.createStatement(); ResultSet rs = st.executeQuery("select * from books where " + cond); %> <table border="1" cellspacing="2" width="100%"> <thead> <tr> <th>Subject</th> <th>Book Name</th> <th>Authors</th> <th>Publisher</th> <th>Purchased On</th> <th>Price</th> <th>Status</th> <th>&nbsp;</th> </tr> </thead> <% while ( rs.next()) { 77

%> <tr> <td><%=rs.getString("subject")%></td> <td><%=rs.getString("name")%></td> <td><%=rs.getString("authors")%></td> <td><%=rs.getString("publisher")%></td> <td><%=rs.getString("dp")%></td> <td><%=rs.getString("price")%></td> <td><%=rs.getString("status")%></td> <td> <% if ( rs.getString("status").equals("a")) out.println("<a style='color:black;text-decoration: underline' href=issuebook.jsp?bid=" + rs.getString("bid") + ">Issue</a>"); else out.println("<a style='color:black;text-decoration: underline' href=returnbook.jsp?bid=" + rs.getString("bid") + ">Return</a>"); %> </td> </tr> <% } rs.close(); st.close(); con.close(); %> 78

</table> </td> </table> </body> </html> Searchmember.jsp <%@page contentType="text/html"%> <%@page pageEncoding="UTF-8"%> <%@page import="java.sql.*"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <link rel="stylesheet" href="styles.css"/> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Search For Members</title> <style> a { color:white; text-decoration: none ; font-size: 12pt;padding-left: 20px;} a:hover { text-decoration: underline; } </style> </head> <body> <center> <h1>Library Management</h1> 79

</center> <table border="0" width="100%" height="100%" > <tbody> <tr> <td bgcolor="navy" width="25%" valign="top"> <br/> <br/> <a href="editbook.jsp">Edit Book</a> <br/> <br/> <a href="deletebook">Delete Book</a> <br/> <br/> <a href="searchbook.jsp">Search Book</a> <br/> <br/> <a href="logout.jsp">Logout</a> <br/> <br/> </td> <td valign="top"> <h2>Search For Members</h2> <form action="searchmember.jsp"> <table border="0"> <tbody> <tr> <td>Member Name</td> 80

<td><input type="text" name="mname" value="" /></td> </tr> </tbody> </table> <input type="submit" value="Search" /> <input type="button" value="Cancel" onclick="javascript:document.URL='home.jsp'" /> </form> <% if ( request.getParameter("mname") == null ) return; String cond=" 1 = 1 "; String mname = request.getParameter("mname"); if ( mname.length() > 0) cond += " and upper(name) like '%" + mname.toUpperCase() + "%'"; Connection con = lm.Database.getConnection(); Statement st = con.createStatement(); ResultSet rs = st.executeQuery("select * from members where " + cond); %> <table border="1" cellspacing="2" width="100%"> <thead> <tr> <th>Member ID</th> <th>Member Name</th> <th>Address</th> <th>city</th> <th>State</th> 81

<th>Phone No</th> <th>Email Id</th> <th>Membership Date</th> <th>Amount Deposited</th> </tr> </thead> <% while ( rs.next()) { %> <tr> <td><%=rs.getInt("mid")%></td> <td><%=rs.getString("name")%></td> <td><%=rs.getString("address")%></td> <td><%=rs.getString("city")%></td> <td><%=rs.getString("state")%></td> <td><%=rs.getString("phoneno")%></td> <td><%=rs.getString("email")%></td> <td><%=rs.getString("djoin")%></td> <td><%=rs.getInt("depamt")%></td> </tr> <% } rs.close(); st.close(); con.close(); %> 82

</table> </td></table> </body> </html> Bookbean.java package lm; import java.sql.*; public class BookBean { private String bname,authors,publisher,dp,subject; private int price; public String getBname() { return bname; } public void setBname(String bname) { this.bname = bname; } public String getAuthors() { return authors; } public void setAuthors(String authors) { this.authors = authors; } public String getPublisher() { return publisher; } 83

public void setPublisher(String publisher) { this.publisher = publisher; } public String getDp() { return dp; } public void setDp(String dp) { this.dp = dp; } public String getSubject() { return subject; } public void setSubject(String subject) { this.subject = subject; } public int getPrice() { return price; } public void setPrice(int price) { this.price = price; } public int addBook() { Connection con=null; PreparedStatement ps=null; int bid=0; try 84

{ con = Database.getConnection(); ps = con.prepareStatement("select nvl(max(bid),0) + 1 from books"); ResultSet rs = ps.executeQuery(); if(rs.next()) bid = rs.getInt(1); else bid=1; rs.close(); ps = con.prepareStatement("insert into books values (?,?,?,?,?,?,?,'a')"); ps.setInt(1,bid); ps.setString(2,bname); ps.setString(3,authors); ps.setString(4,publisher); ps.setString(5,subject); ps.setInt(6,price); ps.setString(7,dp); if ( ps.executeUpdate() == 1) return bid; else return -1; } catch(Exception ex) { System.out.println(ex.getMessage()); return -1; } 85

finally { Database.clean(con,ps); } } } Database.java package lm; import java.sql.*; public class Database { public static Connection getConnection() { try { Class.forName("oracle.jdbc.driver.OracleDriver"); Connection con = .getConnection("jdbc:oracle:thin:@localhost:1521:XE", "lm","lm"); return con; } catch(Exception ex) { System.out.println(ex.getMessage()); return null; } } public static void clean(Connection con, Statement st) 86

{ try { st.close(); con.close(); } catch(Exception ex) {} } } Memberbean.java package lm; import java.sql.*; public class MemberBean { private String mname,address,city,state,ph,email,doj,pin; private int amt; public String getMname() { return mname; } public void setMname(String mname) { this.mname = mname; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } 87

public String getCity() { return city; } public void setCity(String city) { this.city = city; } public String getDoj() { return doj; } public void setDoj(String doj) { this.doj = doj; } public String getState() { return state; } public void setState(String state) { this.state = state; } public String getPin() { return pin; } public void setPin(String pin) { this.pin = pin; } public int getAmt() { return amt; 88

} public void setAmt(int amt) { this.amt = amt; } public String getPh() { return ph; } public void setPh(String ph) { this.ph = ph; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public int addMember() { Connection con=null; PreparedStatement ps=null; int mid=0; try { con = Database.getConnection(); ps = con.prepareStatement("select nvl(max(mid),0) + 1 from members"); 89

ResultSet rs = ps.executeQuery(); if(rs.next()) mid = rs.getInt(1); else mid=1; rs.close(); ps = con.prepareStatement("insert into members values (?,?,?,?,?,?,?,?,?,?)"); ps.setInt(1,mid); ps.setString(2,mname); ps.setString(3,address); ps.setString(4,city); ps.setString(5,state); ps.setString(6,pin); ps.setString(7,ph); ps.setString(8,email); ps.setString(9,doj); ps.setInt(10,amt); if ( ps.executeUpdate() == 1) return mid; else return -1; } catch(Exception ex) { System.out.println(ex.getMessage()); return -1; 90

} finally { Database.clean(con,ps); } } } Transactionbean.java package lm; import java.sql.*; public class TransactionBean { public TransactionBean() { } public boolean issueBook(String bid, String mid, String user) { Connection con=null; PreparedStatement ps=null; try { con = Database.getConnection(); ps = con.prepareStatement("insert into issues values(?,?,sysdate,?)"); ps.setString(1,bid); ps.setString(2,mid); ps.setString(3,user); if ( ps.executeUpdate() == 0 ) return false; 91

ps = con.prepareStatement("update books set status='i' where bid = ?"); ps.setString(1,bid); if ( ps.executeUpdate() == 0) return false; return true; } catch(Exception ex) { System.out.println(ex.getMessage()); return false; } } public boolean returnBook(String bid, String user) { Connection con=null; PreparedStatement ps=null; try { con = Database.getConnection(); ps = con.prepareStatement("select mid, to_char(di,'dd-mon-yy') di ,issuedby from issues where bid = ?"); ps.setString(1,bid); ResultSet rs = ps.executeQuery(); if ( ! rs.next()) return false; String mid = rs.getString("mid"); String di = rs.getString("di"); String issuedby = rs.getString("issuedby"); 92

rs.close(); ps.close(); ps = con.prepareStatement("insert into returns values (?,?,?,?,sysdate,?)"); ps.setString(1,bid); ps.setString(2,mid); ps.setString(3,di); ps.setString(4,issuedby); ps.setString(5,user); if ( ps.executeUpdate() == 0 ) return false; ps = con.prepareStatement("delete from issues where bid = ?"); ps.setString(1,bid); if ( ps.executeUpdate() == 0 ) return false; ps = con.prepareStatement("update books set status='a' where bid = ?"); ps.setString(1,bid); if ( ps.executeUpdate() == 0) return false; return true; } catch(Exception ex) { System.out.println(ex.getMessage()); return false; } } } Userbean.java package lm; 93

import java.sql.*; import java.util.*; public class UserBean { private String lname,pwd,fullname; public void setPwd(String pwd) { this.pwd= pwd; } public String getPwd() { return pwd; } public boolean login() { Connection con = null; PreparedStatement ps = null; boolean logged = false; try { con = Database.getConnection(); ps = con.prepareStatement("select fullname from users where lname = ? and pwd= ?"); ps.setString(1,lname); ps.setString(2,pwd); ResultSet rs = ps.executeQuery(); if ( rs.next()) { fullname = rs.getString("fullname"); logged = true; } 94

} catch(Exception ex) { System.out.println( ex.getMessage()); } finally { Database.clean(con,ps); } return logged; } public boolean updateProfile(String email, String qual, String exp) { Connection con = null; PreparedStatement ps= null; try { con = Database.getConnection(); String cmd = "update users set email = ? , qual =?, exp = ? where uname = ? "; ps = con.prepareStatement(cmd); ps.setString(1,email); ps.setString(2,qual); ps.setString(3,exp); ps.setString(4,uname); int cnt = ps.executeUpdate(); if ( cnt==1 ) 95

return true; else return false; } catch(Exception ex) { System.out.println( ex.getMessage()); return false; } finally { Database.clean(con,ps); } } public boolean updatePassword(String newpwd) { Connection con = null; PreparedStatement ps= null; try { con = Database.getConnection(); String cmd = "update users set pwd=? where uname = ? "; ps = con.prepareStatement(cmd); ps.setString(1,newpwd); ps.setString(2,uname); int cnt = ps.executeUpdate(); if ( cnt==1 ) 96

{ pwd = newpwd; return true; } else return false; } catch(Exception ex) { System.out.println( ex.getMessage()); return false; } finally { Database.clean(con,ps); } } public String getLname() { return lname; } public void setLname(String lname) { this.lname = lname; } public String getFullname() { return fullname; } 97

public void setFullname(String fullname) { this.fullname = fullname; } }

98

OUTPUTS

99

100

101

102

103

104

105

106

107

108

SYSTEM IMPLEMENTATION Implementation is the stage in the project where the theoretical design is turned into a working system. The implementation phase constructs, installs and operates the new system. The most crucial stage in achieving a new successful system is that it will work efficiently and effectively. There are several activities involved while implementing a new project they are End user training End user Education Training on the application software System Design Parallel Run And To New System Post implementation Review End user Training: The successful implementation of the new system will purely upon the involvement of the officers working in that department. The officers will be imparted the necessary training on the new technology. End User Education: The education of the end user start after the implementation and testing is over. When the system is found to be more difficult to under stand 109

and complex, more effort is put to educate the end used to make them aware of the system, giving them lectures about the new system and providing them necessary documents and materials about how the system can do this. Training of application software: After providing the necessary basic training on the computer awareness, the users will have to be trained upon the new system such as the screen flows and screen design type of help on the screen , type of errors while entering the data , the corresponding validation check at each entry and the way to correct the data entered. It should then cover information needed by the specific user or group to use the system. Post Implementation View: The department is planning a method to know the states of t he past implementation process. For that regular meeting will be arranged by the concerned officers about the implementation problem and success

110

SOFTWARE TESTING

Is the menu bar displayed in the appropriate contested some system related features included either in menus or tools? Do pull Down menu operation and Tool-bars work properly? Are all menu function and pull down sub function properly listed ?; Is it possible to invoke each menu function using a logical assumptions that if all parts of the system are correct, the goal will be successfully achieved .? In adequate testing or nontesting will leads to errors that may appear few months later. This create two problem 1. Time delay between the cause and appearance of the problem. 2. The effect of the system errors on files and records within the system The purpose of the system testing is to consider all the likely variations to which it will be suggested and push the systems to limits. The testing process focuses on the logical intervals of the software ensuring that all statements have been tested and on functional interval is conducting tests to uncover errors and ensure that defined input will produce actual results that agree with the required results. Program level testing, modules level testing integrated and carried out. There are two major type of testing they are 1) White Box Testing. 2) Black Box Testing.

111

White Box Testing White box some times called Glass box testing is a test case design uses the control structure of the procedural design to drive test case. Using white box testing methods, the following tests where made on the system A) All independent paths within a module have been exercised once. In our system, ensuring that case was selected and executed checked all case structures. The bugs that were prevailing in some part of the code where fixed b) All logical decisions were checked for the truth and falsity of the values. Black box Testing Black box testing focuses on the functional requirements of the software. This is black box testing enables the software engineering to derive a set of input conditions that will fully exercise all functional requirements for a program. Black box testing is not an alternative to white box testing rather it is complementary approach that is likely to uncover a different class of errors that white box methods like.. 1) Interface errors 2) Performance in data structure 3) Performance errors 4) Initializing and termination errors

112

CONCLUSION

Our project is only a humble venture to satisfy the needs in a library. Several user friendly coding have also adopted. This package shall prove to be a powerful package in satisfying all the requirements of the organization. The objective of software planning is to provide a frame work that enables the manger to make reasonable estimates made within a limited time frame at the beginning of the software project and should be updated regularly as the project progresses.

113

BIBLIOGRAPHY

1. Khalid A. Mughal, Rolf W. Rasmussen eight Impression,2008 2. Phill Hanna, JSP: The complete Reference 3. jaworski, Java 2 Platform, Techmedia. 4. Dieter Gollmann,Computer Security, Johan Wiley & sons. 5. Elias M. Awad, System Analysis and Design, IInd edition 6. Roger S. Pressman, Software Engineering (A Practitoners Approach), The Mc Graw-Hill Companies, 5th Edition 2002.

Web Sites: a. b. c. d. e. www.google.com www.jakarta.apache.org www.jdk.com www.en.wikipedia.org www.java.com

114

You might also like