Вы находитесь на странице: 1из 34

BOOK BANK MANAGEMENT SYSTEM

PROBLEM ANALYSIS AND REQUIREMENT ANALYSIS

1.INTRODUCTION
The main objective of the document is to illustrate the functions and working procedures of the
project Book Bank Management System. The document gives the detailed description of both functional
and non-functional requirements. The document aims at elaborating the process involved in maintaining
an Book Bank Management System and focuses on the operations involved in the process. It will also
explain about the various system interfaces and constraints employed in the project. The document is
developed after a complete analysis and consultation from the team members and specifications for the
given project.

1.1 OBJECTIVE
The purpose of the project is to illustrate the steps involved in online book management. The availability
of books can be estimated without much of manual involvement.

1.2 SCOPE
The software provides the customer, visitor and administrator an easy and efficient way to purchase and
manage books online.
The software provides the following facilities to the customer:
Enables easy online shopping
Provides e-mail facility for future correspondence
Facilitates user friendly interactions
Provides a detailed description about the products in all genres.

1.3 ABBREVIATIONS AND ACRONYMS


BBMS- Book Bank Management System
ACK-Acknowledgement

1.4 REFERENCES
None

1.5 PROBLEM STATEMENT


The Book Bank Management System is built up to serve the user with their required books and
provide easy intractable environment. Here, the users can become a member (included in the database) by
registering themselves. Now the members can search for the books that they need and can obtain the book
details if necessary. The administrator can update the database with all new details regarding both the
customer and the books. The main aim of this project is to minimize the work load of any user and retrieve
the desired book in an efficient way. By automating book purchases a beneficial outcome is expected.
1.6 PRODUCT FEATURES
For buying of books through internet we are tasked to build up the Book Bank Management System.
This is done to avoid the manual work load involved in buying of books from a store. The system will
have a windows based desktop interface to allow the publishers to enter the books, update them and
generate required reports. For security reasons the administrator can only validate the publishers and also
the customers by providing with their publisher ID and customer ID respectively.

SYSTEM REQUIREMENTS
This product requires the minimum of the following:
Windows XP/Vista/7 OS
512MB DDR3 RAM
Argo UML
Eclipse IDE
Java Scripting
MS Access

1.7 CONSTRAINTS
The main constraint lies on the need for any customer or publisher to register them with the Database
in the site to gain access to the Book Bank Management System.
2. SRS DOCUMENTATION (IEEE Standard)
2.1 Functional Requirements
A functional requirement defines a function of a software system on its component. A function is
described as a set of inout,the behaviour and output.
i. A main menu including a brief help section.
ii. Login
iii. Viewing book details.
iv. Displaying details.
v. Maintain and update book details.
vi. Logout.

1. Requirements:
The system should have the requirements of the project. The developer should prepare the
requirements of the project.
2. Design:
Project manager should design the layout of the project before going to implement time
allocation, cost allocation and staff allocation will coming under design process.
3. Implementation:
After encompassing all the diagrams, we have to generate code for each and every diagrams
i.e. from usecase to deployment.
4. Testing:
After implementing the diagram with domain language, we have to test the particular
projects.
5. Maintenance:

CS6511 CASE TOOLS LABORATORY


The system should be easily updated. The system should utilize the interchangeable plugins
software developed should maintain the cost and time schedule of the project.

2.2 Non-Functional Requirements


Non-functional requirements define the needs in terms if performance, logical database
requirements, design constraints, standard compliance, reliability, availability, security, maintainability
and portability.
1. Performance Requirements:
Performance requirements define acceptable response times for system functionality.
A) The total time for user interface screens will take no longer than two seconds.
B) The login information shall be verified within the seconds.
C) Queries shall results within five seconds.

2. Design Constraints:
The software shall be a standard system running in a windows environment. The system
shall be developed using rational enterprise suite and oracle 10i database.
3. Reliability:
Specify the factors required to establish the required reliability of the software system at
time of delivery.
4. Availability:
The system should have an availability of 99.99%.
5. Portability:
A) The system should be extremely via the usb drive.
B) The system shall be easy to migrate or backed up via another use drive.
6. Maintainability:
A) The system shall utilize interchangeable plugins.
B) The system shall be easily updateable for fixes and patches.

2.3 BEHAVIOURAL REQUIREMENTS:


Behavioral requirements are used to describe the overall behavior of the system. Requirements are
essential to meet the needs. These behavioral requirements represent what actions to be taken on occurrence
of particular event.

2.4. INFORAMTON REQUIREMENTS:


2.4.1 DATA MODEL:
1.a.i.i) Data object: applicant, admin, transaction, verification.
1.a.i.ii) Attribute: username, password, credit card no, etc.

2.4.2 DATA DICTIONARY:


i) USERNAME: A person who login to perform registration

CS6511 CASE TOOLS LABORATORY


ii) PASSOWRD: password of the specified user
iii) ADDRESS: address of the user who login

2.5. EXTERNAL INTERFACE:


2.5.1 Hardware Requirements:
Processor: Pentium IV
Hard drive: 320 GB
RAM: 4GB
2.5.2 Software Requirements:
Operating system: Windows XP/7/8/8.1
Front-end: Agro UML, Eclipse IDE
Back-end: MS Access 2007.

2.6 Risk Activity:


*Personal short falls.
*Unrealistic schedules and budgets.
*Developing the wrong functions and programs.
*Developing the wrong user interface.
*Continuing stream of requirements changes.
*Short falls in externally furnished component.
*Real time performance short falls.
*Straining computer science capabilities.
1. Risk Assessment:
A) Figure out what the risks are and what to focus on.
B) Making a list of all of the potential dangers that will affect the project.
C) Assessing the probability of occurrence and potential ross of each item listed.
1. Risk Control:
A) Monitoring the effectiveness of the strategies and the changing levels of risk throughout
the project.
B) Techniques and strategies to migrate the highest ordered risks.

2.7 Gantt Chart:


It describes the time schedule for the planning to complete the corresponding and after completion
of core product, what the time is taken for the project action of core product.

CS6511 CASE TOOLS LABORATORY


3. Use Case Documentation in Fully Dressed Format:
1. REGISTER
1.1 Scope: This usecase explains the process of how the user creates an account (becomes a
member) in the Book Bank Management System.
1.2 Basic Flow: This usecase is initiated when an actor wants to create an account in the Book
Bank Management System, for a specific time period. The system requires the actor to enter his/her
name, user id and password and then time interval.
1.3 Alternate Flow: Username already exists. If in basic flow, the customer gives an already
valid username, the system displays an error message. The actor can either return to the beginning
(or) cancel the registration and thus the usecase ends at that point.
1.4 Special Requirements: User/customer database with user specific information.
1.5 Pre-conditions: The user must create an account and thus become a member, for the
required period. The member (customer) must login to the Book Bank Management System.
1.6 Post-condition: If the usecase gets valid, the actor can login to the system, else the system
remains idle with the same status.
1. LOGIN:
a. Scope: This usecase illustrates how the user logs into the Book Bank Management System
using his/her member details.
b. Basic Flow: The usecase starts with actor wants to log into the Book Bank Management
System.
The system asks the actor to enter his/her name, user id and password.
The actor enters the requested details.
The system validates the name, user id and the password. Now the actor becomes logged
into the system.
c. Alternate Flow: If in basic flow the actor enters a mismatched user id and password, the
system displays an error message. The actor can either choose to return to the beginning of the
basic flow (or) cancel the login, thus ending this closure.

CS6511 CASE TOOLS LABORATORY


d. Special Requirements: Customer database, user id and password.
e. Pre-conditions: The user must login using the user id and password.
f. Post-condition: If the usecase was successful, the actor gets logged into the system; else
the system status remains the same.

2. SEARCH BOOK:
a. Scope: This usecase is used to search a particular book from the database based on the
members requirements.
b. Basic Flow: This usecase is used to search a particular book (or) books from the book
database.
c. Alternate Flow: The book requested by the user may not be available (or) the book name
entered may be incorrect.
d. Special Requirements: Book database- book details for searching.
e. Pre-conditions: None
f. Post-condition: If the usecase was successful, the book access link will be displayed for
the user.
3. RETURN/RENEW:
a. Scope: This usecase is used to return/renew a particular book from the database based on
the members requirements.
b. Basic Flow: This usecase starts with actor wishing to login to the System.
The system requests the actor to enter their name and password.
The actor must enter their name and password.
The system will validate their entire name and password and logs the actor into the system.
c. Alternate Flow: The book may not be renewed currently. The actor can try again later,
thus ending the usecase (or) the actor can go back to the beginning of the basic flow.
d. Special Requirements : The user should currently possess the book.
e. Pre-conditions: The book must be associated with the user.
f. Post-conditions: If the usecase was successful, the actor can return/renew a copy of the
book.

3.1 USECASE DIAGRAM:


Use Case diagrams identify the functionality provided by the system (use cases), the users who interact
with the system (actors), and the association between the users and the functionality. Use Cases are used
in the Analysis phase of software development to articulate the high-level requirements of the system.

CS6511 CASE TOOLS LABORATORY


CS6511 CASE TOOLS LABORATORY
3.2. INTERACTION DIAGRAM:
3.2.1 SEQUENCE DIAGRAM:
Sequence diagrams document the interactions between classes to achieve a result, such as a use case.
Because UML is designed for object-oriented programming, these communications between classes are
known as messages.

CS6511 CASE TOOLS LABORATORY


3.2.2. COMMUNICATION DIAGRAM:

Communication diagram illustrates object interactions in a graph or network format, in which objects can
be placed anywhere on the document.

3.3. CLASS DIAGRAM:


A Class diagram gives an overview of a system by showing its classes and the relationships among them.
Class diagrams are static -- they display what interacts but not what happens when they do interact.

CS6511 CASE TOOLS LABORATORY


3.4. ACTIVITY DIAGRAM:
Activity diagrams are used to document workflows in a system, from the business level down to the
operational level. Activity diagram is a variation of the state diagram where the "states" represent
operations, and the transitions represent the activities that happen when the operation is complete.

CS6511 CASE TOOLS LABORATORY


3.5. State chart diagram
UML State diagram represents the events and states of object and the behavior of objects in
reaction to an event. It shows the life cycle of the object.

3.6. Object diagram


Object diagrams are derived from class diagrams so object diagrams are dependent upon class
diagrams. Object diagrams represent an instance of a class diagram. The basic concepts are similar
for class diagrams and object diagrams. Object diagrams also represent the static view of a system
but this static view is a snapshot of the system at a particular moment.

CS6511 CASE TOOLS LABORATORY


7. COMPONENT DIAGRAM:

Component diagram are used to model the physical aspect of the system. It is used to visualize
organization and relationship among the components of the system.

3.8. DEPLOYMENT DIAGRAM:

Deployment diagram shows represents the physical architecture of the system. It represents the
physical deployment of software artifacts on the nodes.

CS6511 CASE TOOLS LABORATORY


IMPLEMENTATION
1. LOGIN

2. REGISTRATION

CS6511 CASE TOOLS LABORATORY


3. ADMIN

4. Open

CS6511 CASE TOOLS LABORATORY


5. SEARCH BOOK

6.RETURN/RENEW

CS6511 CASE TOOLS LABORATORY


PROGRAM CODING:

welcome.java
import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.Color;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.JTextField;
import java.awt.Font;
public class welcome extends JFrame {
private JPanel contentPane;
private JTextField txtEbookwareWelcomesYou;
private JTextField textField_1;
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
welcome frame = new welcome();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace(); } } }); }
public welcome() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 300);
contentPane = new JPanel();
contentPane.setBackground(new Color(255, 250, 205));
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
JButton btnNewButton = new JButton("REGISTER");
btnNewButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
Register r=new Register();
r.setVisible(true); } });
JButton btnNewButton_1 = new JButton("LOGIN");
btnNewButton_1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
Login l=new Login();

CS6511 CASE TOOLS LABORATORY


l.setVisible(true); } });

txtEbookwareWelcomesYou = new JTextField();


txtEbookwareWelcomesYou.setText("E-BOOKWARE Welcomes you!!!!!");
txtEbookwareWelcomesYou.setFont(new Font("Tahoma", Font.PLAIN, 16));
txtEbookwareWelcomesYou.setColumns(10);

textField_1 = new JTextField();


textField_1.setColumns(10);
GroupLayout gl_contentPane = new GroupLayout(contentPane);
gl_contentPane.setHorizontalGroup(
gl_contentPane.createParallelGroup(Alignment.LEADING)
.addGroup(gl_contentPane.createSequentialGroup()
.addGap(63)
.addComponent(txtEbookwareWelcomesYou,
GroupLayout.PREFERRED_SIZE, 339, GroupLayout.PREFERRED_SIZE)
.addContainerGap(30, Short.MAX_VALUE))
.addGroup(Alignment.TRAILING,
gl_contentPane.createSequentialGroup()
.addContainerGap(307, Short.MAX_VALUE)
.addComponent(textField_1, GroupLayout.PREFERRED_SIZE,
GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
.addGap(39))
.addGroup(gl_contentPane.createSequentialGroup()
.addGap(114)
.addComponent(btnNewButton, GroupLayout.DEFAULT_SIZE,
84, Short.MAX_VALUE)
.addGap(43)
.addComponent(btnNewButton_1)
.addGap(128))
);
gl_contentPane.setVerticalGroup(
gl_contentPane.createParallelGroup(Alignment.LEADING)
.addGroup(Alignment.TRAILING,
gl_contentPane.createSequentialGroup()
.addGap(30)
.addComponent(txtEbookwareWelcomesYou,
GroupLayout.PREFERRED_SIZE, 51, GroupLayout.PREFERRED_SIZE)
.addPreferredGap(ComponentPlacement.UNRELATED)
.addComponent(textField_1, GroupLayout.PREFERRED_SIZE,
GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
.addPreferredGap(ComponentPlacement.RELATED, 56,
Short.MAX_VALUE)

.addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE)

CS6511 CASE TOOLS LABORATORY


.addComponent(btnNewButton,
GroupLayout.PREFERRED_SIZE, 32, GroupLayout.PREFERRED_SIZE)
.addComponent(btnNewButton_1,
GroupLayout.PREFERRED_SIZE, 31, GroupLayout.PREFERRED_SIZE))
.addGap(56))
);
contentPane.setLayout(gl_contentPane); }
}

LOGIN.JAVA
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.Color;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import javax.swing.JTextField;
import javax.swing.JButton;
import javax.swing.LayoutStyle.ComponentPlacement;
public class Login extends JFrame {
private JPanel contentPane;
private JTextField textField;
private JTextField textField_1;

public static void main(String[] args) {


EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Login Jframe = new Login();
Jframe.setVisible(true);
} catch (Exception e) {
e.printStackTrace(); } } });
new Login(); }
public Login() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 300);

CS6511 CASE TOOLS LABORATORY


contentPane = new JPanel();
contentPane.setBackground(new Color(255, 240, 245));
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
JLabel lblNewLabel = new JLabel("USER ID:");
lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 14));
textField = new JTextField();
textField.setColumns(10);
textField.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
textField_actionPerformed(e);
}
});
JLabel lblPassword = new JLabel("PASSWORD:");
lblPassword.setFont(new Font("Tahoma", Font.PLAIN, 14));

textField_1 = new JTextField();


textField_1.setColumns(10);
textField_1.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
textField_1_actionPerformed(e);

}
});
JButton btnLogin = new JButton("LOGIN");
btnLogin.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
btnLogin_actionPerformed(e);
}
private void btnLogin_actionPerformed(ActionEvent e)
{
try
{
Class.forName("sun.odbc.JdbcOdbcDriver");
Connection
c=DriverManager.getConnection("jdbc:odbc:ebook1");
PreparedStatement st=c.prepareStatement("SELECT password
FROM Register WHERE password=?");
st.setString(1,textField_1.getText());
ResultSet rs=st.executeQuery();
if(rs.next()){

CS6511 CASE TOOLS LABORATORY


JOptionPane.showMessageDialog(null,"welcome!!!!!:)
:)","Member notification",JOptionPane.PLAIN_MESSAGE);
new Search();
}
else
{
JOptionPane.showMessageDialog(null,"Sorry:( Try again..
Incorrect user name or password","Member notification",JOptionPane.PLAIN_MESSAGE);
new Login();
}
}
catch(Exception ae)
{
System.out.println(ae);
}
Search s=new Search();
s.setVisible(true);

}
});
btnLogin.setFont(new Font("Tahoma", Font.PLAIN, 14));

JButton btnHome = new JButton("HOME");


btnHome.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
welcome w=new welcome();
w.setVisible(true);

}
});
GroupLayout gl_contentPane = new GroupLayout(contentPane);
gl_contentPane.setHorizontalGroup(
gl_contentPane.createParallelGroup(Alignment.TRAILING)
.addGroup(gl_contentPane.createSequentialGroup()
.addGap(57)

.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
.addComponent(lblNewLabel)
.addComponent(lblPassword))
.addGap(43)

.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
.addComponent(btnLogin)

.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING, false)
.addComponent(textField_1)

CS6511 CASE TOOLS LABORATORY


.addComponent(textField,
GroupLayout.DEFAULT_SIZE, 122, Short.MAX_VALUE)))
.addContainerGap(130, Short.MAX_VALUE))
.addGroup(gl_contentPane.createSequentialGroup()
.addContainerGap(351, Short.MAX_VALUE)
.addComponent(btnHome, GroupLayout.PREFERRED_SIZE, 71,
GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
gl_contentPane.setVerticalGroup(
gl_contentPane.createParallelGroup(Alignment.LEADING)
.addGroup(gl_contentPane.createSequentialGroup()
.addComponent(btnHome)
.addGap(42)

.addGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING)
.addComponent(textField,
GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
GroupLayout.PREFERRED_SIZE)
.addComponent(lblNewLabel))
.addGap(48)

.addGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING)
.addComponent(lblPassword)
.addComponent(textField_1,
GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
GroupLayout.PREFERRED_SIZE))
.addPreferredGap(ComponentPlacement.RELATED, 42,
Short.MAX_VALUE)
.addComponent(btnLogin)
.addGap(36))
);
contentPane.setLayout(gl_contentPane);
}

private void textField_actionPerformed(ActionEvent e)


{
System.out.println("\ntextField_actionPerformed(ActionEvent e)called.");
}
private void textField_1_actionPerformed(ActionEvent e)
{
System.out.println("\ntextField_1_actionPerformed(ActionEvent e)called.");
} }

CS6511 CASE TOOLS LABORATORY


REGISTER.java
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import java.awt.Font;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.Color;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
public class Register extends JFrame {
private static final long serialVersionUID = 1L;
private JPanel contentPane;
private JTextField textField;
private JTextField textField_1;
private JTextField textField_2;

public static void main(String[] args) {


EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Register Jframe = new Register();
Jframe.setVisible(true);
} catch (Exception e) {
e.printStackTrace(); } } }); }
public Register() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 300);
contentPane = new JPanel();
contentPane.setBackground(new Color(224, 255, 255));
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);

JLabel lblNewLabel = new JLabel("NAME:");


lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 14));

textField = new JTextField();

CS6511 CASE TOOLS LABORATORY


textField.setColumns(10);
textField.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{ textField_actionPerformed(e); }
private void textField_actionPerformed(ActionEvent e) {
System.out.println("\n textField_actionPerformed(ActionEvent e)called.");
} });
textField_1 = new JTextField();
textField_1.setColumns(10);
textField_1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{ textField_1_actionPerformed(e); }
private void textField_1_actionPerformed(ActionEvent e) {
System.out.println("\n textField_1_actionPerformed(ActionEvent e)called.");
} });
JLabel lblNewLabel_2 = new JLabel("PASSWORD:");
lblNewLabel_2.setFont(new Font("Tahoma", Font.PLAIN, 14));
JLabel label = new JLabel("");
JLabel lblNewLabel_1 = new JLabel("USER ID:");
lblNewLabel_1.setFont(new Font("Tahoma", Font.PLAIN, 14));
JButton btnRegister = new JButton("REGISTER");
btnRegister.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
btnRegister_actionPerformed(e); }
private void btnRegister_actionPerformed(ActionEvent e) {
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection
c=DriverManager.getConnection("jdbc:odbc:ebook1");
PreparedStatement st=c.prepareStatement("insert into
Register values(?,?,?)");
st.setString(1,textField.getText());
st.setString(2,textField_1.getText());
st.setString(3,textField_2.getText());
st.executeUpdate();
st.close();
JOptionPane.showMessageDialog(null,textField_1.getText()+"you
are registered as our member :)","member notification",JOptionPane.PLAIN_MESSAGE);
new Search();
}
catch(Exception ae)
{
System.out.println(ae);
}

CS6511 CASE TOOLS LABORATORY


}
});

JButton btnHome = new JButton("HOME");


btnHome.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
welcome w=new welcome();
w.setVisible(true);

}
});

textField_2 = new JTextField();


textField_2.setColumns(10);
textField_2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
textField_2_actionPerformed(e);
}

private void textField_2_actionPerformed(ActionEvent e) {


System.out.println("\n textField_2_actionPerformed(ActionEvent e)called.");

}
});
GroupLayout gl_contentPane = new GroupLayout(contentPane);
gl_contentPane.setHorizontalGroup(
gl_contentPane.createParallelGroup(Alignment.LEADING)
.addGroup(gl_contentPane.createSequentialGroup()
.addGap(47)

.addGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING)
.addComponent(label)

.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
.addComponent(lblNewLabel_1)
.addComponent(lblNewLabel)
.addComponent(lblNewLabel_2)))
.addPreferredGap(ComponentPlacement.RELATED, 60,
Short.MAX_VALUE)

.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING, false)
.addComponent(textField_2)
.addComponent(textField_1)
.addComponent(textField, GroupLayout.DEFAULT_SIZE,
106, Short.MAX_VALUE))

CS6511 CASE TOOLS LABORATORY


.addGap(89))
.addGroup(gl_contentPane.createSequentialGroup()
.addContainerGap(362, Short.MAX_VALUE)
.addComponent(btnHome, GroupLayout.PREFERRED_SIZE, 70,
GroupLayout.PREFERRED_SIZE))
.addGroup(gl_contentPane.createSequentialGroup()
.addGap(160)
.addComponent(btnRegister)
.addContainerGap(191, Short.MAX_VALUE))
);
gl_contentPane.setVerticalGroup(
gl_contentPane.createParallelGroup(Alignment.LEADING)
.addGroup(gl_contentPane.createSequentialGroup()

.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
.addGroup(gl_contentPane.createSequentialGroup()
.addComponent(btnHome)
.addGap(30)

.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
.addComponent(lblNewLabel)
.addComponent(textField,
GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
GroupLayout.PREFERRED_SIZE))

.addPreferredGap(ComponentPlacement.UNRELATED)

.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)

.addGroup(gl_contentPane.createSequentialGroup()
.addComponent(label)

.addPreferredGap(ComponentPlacement.RELATED)
.addComponent(lblNewLabel_1))
.addComponent(textField_1,
GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
GroupLayout.PREFERRED_SIZE))
.addGap(18)
.addComponent(lblNewLabel_2))
.addGroup(gl_contentPane.createSequentialGroup()
.addGap(122)
.addComponent(textField_2,
GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
GroupLayout.PREFERRED_SIZE)))
.addGap(44)
.addComponent(btnRegister)

CS6511 CASE TOOLS LABORATORY


.addGap(20))
);
contentPane.setLayout(gl_contentPane);
}
}

SEARCH.java
import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.Color;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.JTextField;
import javax.swing.JButton;
import javax.swing.LayoutStyle.ComponentPlacement;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
public class Search extends JFrame {
private JPanel contentPane;
private JTextField textField_1;
private JTextField textField;
private JTextField textField_2;
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Search Jframe = new Search();
Jframe.setVisible(true); }
catch (Exception e) { e.printStackTrace(); }} }); }
public Search() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 300);
contentPane = new JPanel(); contentPane.setBackground(new Color(230, 230,
250)); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);

CS6511 CASE TOOLS LABORATORY


JLabel lblBookName = new JLabel("BOOKNAME:");
lblBookName.setFont(new Font("Tahoma", Font.PLAIN, 14)); JLabel
lblAuthorName = new JLabel("AUTHOR NAME:"); lblAuthorName.setFont(new
Font("Tahoma", Font.PLAIN, 14)); JLabel lblGenre = new JLabel("PUBLICATION:");
lblGenre.setFont(new Font("Tahoma", Font.PLAIN, 14)); textField_1 = new
JTextField();
textField_1.setColumns(10);
textField_1.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
textField_1_actionPerformed(e);
}
private void textField_1_actionPerformed(ActionEvent e) {
System.out.println("\n textField_1_actionPerformed(ActionEvent e)called.");
}
});
textField = new JTextField();
textField.setColumns(10);
textField.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{ textField_actionPerformed(e); }
private void textField_actionPerformed(ActionEvent e) {
System.out.println("\n textField_actionPerformed(ActionEvent e)called."); }
});
textField_2 = new JTextField();
textField_2.setColumns(10);
textField_2.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
textField_2_actionPerformed(e);
}
private void textField_2_actionPerformed(ActionEvent e) { System.out.println("\n
textField_2_actionPerformed(ActionEvent e)called."); } });
JButton btnSearch = new JButton("SEARCH");
btnSearch.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
btnSearch_actionPerformed(e); }
private void btnSearch_actionPerformed(ActionEvent e) { try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c=DriverManager.getConnection("jdbc:odbc:ebook1");
Statement st=c.createStatement(); ResultSet
rs=st.executeQuery("SELECT * FROM Search WHERE BOOKNAME='"+textField.getText()+"'");

CS6511 CASE TOOLS LABORATORY


if(rs.next())
{ JOptionPane.showMessageDialog(null, textField.getText()+"book is available!!!! book will be
downloaded soon","member notification",JOptionPane.PLAIN_MESSAGE); } else {
JOptionPane.showMessageDialog(null, textField.getText()+"is not
available!!! Cannot be downloaded :( ","member notification",JOptionPane.PLAIN_MESSAGE);
}
}
catch(Exception ae)
{
System.err.println(ae); } }
});
JButton btnHome = new JButton("HOME");
btnHome.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {

Welcome w=new Welcome();


w.setVisible(true); } });
JButton btnLogout = new JButton("LOGOUT");
btnLogout.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JOptionPane.showMessageDialog(null, "Thank you!! Visit again :) :) :)","member
notification",JOptionPane.PLAIN_MESSAGE); } });
GroupLayout gl_contentPane = new GroupLayout(contentPane);
gl_contentPane.setHorizontalGroup(
gl_contentPane.createParallelGroup(Alignment.LEADING)
.addGroup(gl_contentPane.createSequentialGroup()
.addGap(36)
.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
.addComponent(lblAuthorName)addComponent(lblBookName)
.addComponent(lblGenre))
.addGap(67)
.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
.addComponent(textField_2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
GroupLayout.PREFERRED_SIZE) .addComponent(textField,
GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
.addComponent(textField_1, GroupLayout.PREFERRED_SIZE,
GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addContainerGap(146, Short.MAX_VALUE))
.addGroup(Alignment.TRAILING, gl_contentPane.createSequentialGroup()
.addContainerGap(185, Short.MAX_VALUE)
.addComponent(btnSearch) .addGap(174))
.addGroup(Alignment.TRAILING, gl_contentPane.createSequentialGroup()

CS6511 CASE TOOLS LABORATORY


.addContainerGap(300, Short.MAX_VALUE)
.addComponent(btnHome)
.addPreferredGap(ComponentPlacement.RELATED)
.addComponent(btnLogout)
.addContainerGap())
);
gl_contentPane.setVerticalGroup(
gl_contentPane.createParallelGroup(Alignment.LEADING)
.addGroup(gl_contentPane.createSequentialGroup()
.addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE)
.addComponent(btnLogout)
.addComponent(btnHome))
.addGap(28)
.addGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING)
.addComponent(lblBookName)
.addComponent(textField, GroupLayout.PREFERRED_SIZE,
GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addGap(25)
.addGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING)
.addComponent(textField_1, GroupLayout.PREFERRED_SIZE,
GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
.addComponent(lblAuthorName))
.addGap(31)
.addGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING)
.addComponent(lblGenre)
.addComponent(textField_2, GroupLayout.PREFERRED_SIZE,
GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addPreferredGap(ComponentPlacement.RELATED, 36,
Short.MAX_VALUE)
.addComponent(btnSearch)
.addGap(30))
); contentPane.setLayout(gl_contentPane);
} }

CS6511 CASE TOOLS LABORATORY


OUTPUT:
Welcome

Register

CS6511 CASE TOOLS LABORATORY


Login

Search Book Found:

CS6511 CASE TOOLS LABORATORY


Database:
Register:

Before Updating:

CS6511 CASE TOOLS LABORATORY


After Updating:

Search Database:

CS6511 CASE TOOLS LABORATORY


RESULT:
Thus the project Book Bank Management System was designed and tested successfully
using Eclipse IDE.

CS6511 CASE TOOLS LABORATORY

Вам также может понравиться