Professional Documents
Culture Documents
Project Category:: Content Beyond The Syllabus Library Management System Project in JAVA
Project Category:: Content Beyond The Syllabus Library Management System Project in JAVA
Project category :
RDBMS
Proposed System:
In the proposed system, we assume that each member will be having a identity card which can be
used for the library book issue, fine payment etc. whenever library member wish to take a book,
the book issued by the library authority will be check both the book details as well as the student
details and store it in library database. In case of retrieval of book much of human intervention
can be eliminated.
Module Description:
Book return: Here student will return the books to the library…
2. Administrator Module:
This is the main module in the proposed project. The administrator can read and write
information about any member. The administrator can also update, create and delete the record
of membership as per requirement and implementation plans.
Register student: Allow the administrator to register new student and update the student
records.
Book issue: Here administrator issues the books to the student from library.
Future scope of the project:
We can consider much future scope to this application. The following are some of there.
Online use of the library can be good feature for the Library Management system.
Advanced fine payment system can be added.
Inventory system can be used to maintain the books of the library.
Hardware requirement :
Software requirement :
Java language
Net beans IDE 7.0.1
MS SQL server 2005
import java.util.*;
import java.text.*;
import java.sql.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.border.*;
import javax.swing.table.*;
import javax.swing.plaf.metal.*;
//JButton Variables
JButton bttnAddNew = new JButton("Add New",new ImageIcon("@imgs/add
new.gif"));
JButton bttnEdit = new JButton("Edit", new
ImageIcon("@imgs/edit.gif"));
JButton bttnRemove = new JButton("Remove", new
ImageIcon("@imgs/remove.gif"));
JButton bttnSearch = new JButton("Search", new
ImageIcon("@imgs/search.gif"));
JButton bttnPreview = new JButton("Preview",new
ImageIcon("@imgs/preview.gif"));
JButton bttnRefresh = new JButton("Refresh",new
ImageIcon("@imgs/refresh.gif"));
JButton bttnExit = new JButton("Cancel", new
ImageIcon("@imgs/cancel.gif"));
//JLabel Variables
JLabel lblHeader = new JLabel();
JLabel lblIcon = new JLabel();
JLabel lblCaption = new JLabel("NOTE: This form contains all
information about the Book Records.");
JFrame JFParentFrame;
mdlFunctions module_func = new mdlFunctions();
mdlSQLStatements module_sql = new mdlSQLStatements();
JFParentFrame = getParentFrame;
cnBooks = conn;
stmtBooks =
cnBooks.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONC
UR_READ_ONLY);
sSQL = "SELECT * FROM qryBooks ORDER BY BookNo ASC";
module_func.setJButton(bttnAddNew,5,390,105,25,"add","Add New");
bttnAddNew.setMnemonic(KeyEvent.VK_A);
bttnAddNew.addActionListener(JBActionListener);
module_func.setJButton(bttnEdit,112,390,99,25,"edit","Edit");
bttnEdit.setMnemonic(KeyEvent.VK_E);
bttnEdit.addActionListener(JBActionListener);
module_func.setJButton(bttnRemove,212,390,100,25,"remove","Remov
e");
bttnRemove.setMnemonic(KeyEvent.VK_R);
bttnRemove.addActionListener(JBActionListener);
module_func.setJButton(bttnSearch,313,390,99,25,"search","Search
");
bttnSearch.setMnemonic(KeyEvent.VK_S);
bttnSearch.addActionListener(JBActionListener);
module_func.setJButton(bttnPreview,414,390,99,25,"preview","Prev
iew");
bttnPreview.setMnemonic(KeyEvent.VK_P);
bttnPreview.addActionListener(JBActionListener);
module_func.setJButton(bttnRefresh,514,390,99,25,"refresh","Refr
esh");
bttnRefresh.setMnemonic(KeyEvent.VK_R);
bttnRefresh.addActionListener(JBActionListener);
module_func.setJButton(bttnExit,614,390,99,25,"exit","Unload
Form");
bttnExit.setMnemonic(KeyEvent.VK_C);
bttnExit.addActionListener(JBActionListener);
module_func.setJLabel(lblHeader,0,0,750,40);
module_func.setJLabel(lblIcon,5,2,50,40);
module_func.setJLabel(lblCaption,60,2,500,40);
lblCaption.setFont(new Font("Dialog", Font.BOLD, 12));
lblCaption.setForeground(new Color(255,255,255));
//Add Labels
jpnlMain.add(lblCaption);
jpnlMain.add(lblIcon);
jpnlMain.add(lblHeader);
//Add Buttons
jpnlMain.add(bttnAddNew);
jpnlMain.add(bttnEdit);
jpnlMain.add(bttnRemove);
jpnlMain.add(bttnSearch);
jpnlMain.add(bttnPreview);
jpnlMain.add(bttnRefresh);
jpnlMain.add(bttnExit);
getContentPane().setLayout(new BorderLayout(0,0));
getContentPane().add(BorderLayout.CENTER, jpnlMain);
setFrameIcon(new ImageIcon("@imgs/Books.gif"));
setSize(728,450);
setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
setLocation((screen.width - 728)/2,((screen.height-450)/2)-45);
}
ActionListener JBActionListener = new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
String srcObj = e.getActionCommand();
if(srcObj=="add")
{
JDialog JDAdd = new
frmAddEditBooks(true,JFParentFrame,cnBooks,"");
JDAdd.show();
}
else if(srcObj=="edit")
{
if(total != 0){
try
{
if(JTBooksTbl.getValueAt(JTBooksTbl.getSelectedR
ow(),JTBooksTbl.getSelectedColumn()) != null)
{
JDialog JDEdit = new
frmAddEditBooks(false,JFParentFrame,cnBooks,"SELECT * FROM qryBooks
WHERE BookNo ='" + JTBooksTbl.getValueAt(JTBooksTbl.getSelectedRow(),0)
+ "'");
JDEdit.show();
}
}
catch(Exception sqlE)
{
if(sqlE.getMessage() != null)
{System.out.println(sqlE.getMessage());}
else
{
JOptionPane.showMessageDialog(null,"Please
select a record in the list to modify.","No Record
Selected",JOptionPane.INFORMATION_MESSAGE);
}
}
}
}
else if(srcObj=="remove")
{
if(total != 0){
try
{
if(JTBooksTbl.getValueAt(JTBooksTbl.getSelectedR
ow(),JTBooksTbl.getSelectedColumn()) != null)
{
String ObjButtons[] = {"Yes","No"};
int PromptResult =
JOptionPane.showOptionDialog(null,"Are you sure you want to removed " +
JTBooksTbl.getValueAt(JTBooksTbl.getSelectedRow(),2) + " in the
record?","Delete
Record",JOptionPane.DEFAULT_OPTION,JOptionPane.ERROR_MESSAGE,null,ObjBut
tons,ObjButtons[1]);
if(PromptResult==0)
{
module_sql.recREMOVE(true,
stmtBooks,"qryBooks", "BookNo", JTBooksTbl,0);
reloadRecord(sSQL);
JOptionPane.showMessageDialog(null,"Reco
rd has been successfully removed.","Comfirm
Delete",JOptionPane.INFORMATION_MESSAGE);
}
}
}
catch(Exception sqlE)
{
if(sqlE.getMessage()!=null)
{
JOptionPane.showMessageDialog(null,"You
cannot delete this Book because it is being used by another user.\nIn
order to delete this book, delete its data from another table.","Comfirm
Delete",JOptionPane.WARNING_MESSAGE);
}
else
{
JOptionPane.showMessageDialog(null,"Please
select a record in the list to deleted.","No Record
Selected",JOptionPane.INFORMATION_MESSAGE);
}
}
}
}
else if(srcObj=="search")
{
JDialog JDSearch = new frmSearch(JFParentFrame,
"Books");
JDSearch.show();
}
else if(srcObj == "refresh"){reloadRecord("SELECT * FROM
qryBooks ORDER BY BookNo ASC");}
else if(srcObj=="exit"){dispose();}
}
};