Documente Academic
Documente Profesional
Documente Cultură
By,
Rahul Kumar(15MCA1015)
Arijeet Kumar(15MCA1025)
Deepak M.Chakrasali(15MCA1013)
Introduction
In todays era computers have become a vital
component of any enterprise for giving it proper
directions and extensive control of the various
activities
to
attain
business
objectives.
Computer applications have affected scientific &
commercial knowledge.
The information System of the old times totally
differs from the today It is automation system
of a book shop or any information system. In the
previous ages the process of maintaining data
and record seemed very difficult. Now days,
computer
is
very
essential
component.
The
implementation of computer based Information
System can be depicted as the ease in handling
and maintaining the data bank of any size.
Our project is on Book Shop Management System
which deals with almost all the information of
Book Shop .It keeps the database of customer
records and publishing records. It also keeps
the author list, charges and Book-title list.
1.
2.
3.
4.
table.
ER-Diagram
BookTitle
Password
User-Name
Author
name
Price
Book-id
Pub-year
Have Access
Employe
e
Book_
Details
N
1
maintains
ISBN-NO
M
Have
Have
BOOK-ID
Add
Books
Add-Books
Table
TABLE
views
M
PDF table
M
PDF
Book_ID
Maintains
Admin
CODING
import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
import java.sql.*;
import java.io.File;
public class bookshop implements ActionListener
{
CheckboxGroup cgb;
Checkbox g1,g2;
//JPanel p,p1,p2;
Choice j1,j2,j3;
TextArea x,x1;
String st,st1,sets;
JTextField tz,t,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12;
JPasswordField tz1;
JButton
bb,bb1,bb2,bb3,bb4,bb5,bb6,bb7,bb8,b1,b2,b5,bx,but1,but2,but3,but4,but40,
but5,but6,but7,bx1,by1;
int i=0;
String naam,passw,user;
Timer timer;
JLabel images=new JLabel();
ImageIcon p1,p2,p3,p4,p5,p6;
JFrame f,ffc,f2,f1,f3;
public void design()
{
ffc=new JFrame();
Container cc=ffc.getContentPane();
ffc.setSize(766,468);
ffc.setLocation(300,150);
ffc.setResizable(false);
cc.setBackground(new Color(255,255,255));
ffc.setLayout(null);
ffc.setTitle("LOGIN");
//ImageIcon pk1=new ImageIcon("log.jpg");
//JLabel ll1=new JLabel(pk1);
//ll1.setBounds(1,100,129,281);
ImageIcon pk=new ImageIcon("heade1.jpg");
JLabel ll=new JLabel(pk);
ll.setBounds(25,5,195,122);
ImageIcon pk1=new ImageIcon("book1.jpg");
JLabel ll1=new JLabel(pk1);
ll1.setBounds(10,135,250,250);
cc1.setBackground(new Color(255,255,255));
f.setLayout(null);
ImageIcon x1=new ImageIcon("hhh.jpg");
JLabel y1=new JLabel(x1);
y1.setBounds(100,0,1366,160);
JLabel w1=new JLabel();
w1.setText(naam);
w1.setBounds(5,5,70,25);
ImageIcon ii1=new ImageIcon("yb.png");
but1=new JButton(ii1);
but1.setBackground(Color.yellow);
but1.setBounds(100,200,129,150);
but1.addActionListener(this);
t=new JTextField();
//t.setBackground(Color.red);
t.setBounds(250,50,300,35);
t.setFont(new Font("arial",Font.BOLD,20));
//t.setForeground(Color.blue);
t1=new JTextField();
//t1.setBackground(Color.red);
t1.setBounds(250,130,300,35);
t1.setFont(new Font("arial",Font.BOLD,20));
// t1.setForeground(Color.blue);
t2=new JTextField();
//t2.setBackground(Color.red);
t2.setBounds(250,205,300,35);
t2.setFont(new Font("arial",Font.BOLD,20));
//t2.setForeground(Color.blue);
mm3.setBounds(15,270,225,45);
t3=new JTextField();
//t3.setBackground(Color.red);
t3.setBounds(250,275,300,35);
t3.setFont(new Font("arial",Font.BOLD,20));
//t3.setForeground(Color.blue);
t4=new JTextField();
//t4.setBackground(Color.red);
t4.setBounds(260,355,300,35);
t4.setFont(new Font("arial",Font.BOLD,20));
// t4.setForeground(Color.blue);
but5=new JButton("BACK");
but5.setBackground(Color.white);
but5.setBounds(200,444,150,43);
but5.addActionListener(this);
but6=new JButton("SUBMIT");
but6.setBackground(Color.white);
but6.setBounds(400,444,150,43);
but6.addActionListener(this);
c2.add(mm);c2.add(t);c2.add(mm1);
c2.add(t1);c2.add(mm2);c2.add(t2);
c2.add(mm3);c2.add(t3);c2.add(mm4);
c2.add(t4);c2.add(but5);c2.add(but6);
f2.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
t11=new JTextField();
//t.setBackground(Color.red);
t11.setBounds(250,50,300,35);
t11.setFont(new Font("arial",Font.BOLD,20));
//t.setForeground(Color.blue);
t12=new JTextField();
//t1.setBackground(Color.red);
t12.setBounds(250,130,300,35);
t12.setFont(new Font("arial",Font.BOLD,20));
// t1.setForeground(Color.blue);
bx1=new JButton("BACK");
bx1.setBackground(Color.white);
bx1.setBounds(200,250,150,43);
bx1.addActionListener(this);
by1=new JButton("SUBMIT");
by1.setBackground(Color.white);
by1.setBounds(400,250,150,43);
by1.addActionListener(this);
c3.add(mm);c3.add(t11);c3.add(mm1);
c3.add(t12);c3.add(bx1);c3.add(by1);
f3.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
if(ae.getSource()==but4)
{
String test1;
int n;
test1= JOptionPane.showInputDialog("1.rko1.pdf\n\n2.help1.pdf\n\n Input ur choice
");
n=Integer.parseInt(test1);
if(n==1)
{
try {
if ((new File("D:\\rko.pdf")).exists())
{
}
else
{
System.out.println("File does not exists");
}
}
catch (Exception ex)
{
ex.printStackTrace();
}
if(n==2)
{
try {
if ((new File("D:\\help1.pdf")).exists())
{
Process p = Runtime.getRuntime() .exec("rundll32 url.dll,FileProtocolHandler
D:\\help1.pdf");
p.waitFor();
}
else
{
if(ae.getSource()==but40)
{
f.setVisible(false);
f3.setVisible(true);
if(ae.getSource()==bx1)
{
f3.setVisible(false);
f.setVisible(true);
}
if(ae.getSource()==by1)
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
int r=ps.executeUpdate();
JOptionPane.showMessageDialog(null,"RECORD INSERTED.......");
t11.setText("");
t12.setText("");
ps.close();
conn.close();
}
catch(Exception boo)
{
System.out.println(boo);
}
if(ae.getSource()==bb)
{
//user=tz.getText();
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
else
{
JOptionPane.showMessageDialog(null,"INVALID USERNAME &
PASSWORD","ERROR",JOptionPane.ERROR_MESSAGE);
tz.setText("");
tz1.setText("");
}
}
if(ae.getSource()==bb1)
{
System.exit(0);
}
if(ae.getSource()==but1)
{
f.setVisible(false);
f2.setVisible(true);
}
if(ae.getSource()==but5)
{
f2.setVisible(false);
f.setVisible(true);
}
if(ae.getSource()==but6)
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String vc=t.getText();
String vc1=t1.getText();
String vc2=t2.getText();
String vc3=t3.getText();
String vc4=t4.getText();
ps.setString(1,vc);
ps.setString(2,vc1);
ps.setString(3,vc2);
ps.setString(4,vc3);
ps.setString(5,vc4);
int r=ps.executeUpdate();
JOptionPane.showMessageDialog(null,"RECORD INSERTED.......");
t.setText("");
t1.setText("");
t2.setText("");
t3.setText("");
t4.setText("");
ps.close();
conn.close();
}
catch(Exception boo)
{}
}
if(ae.getSource()==but2)
{
try
{
String test1;
test1= JOptionPane.showInputDialog("Please input Book_Id: ");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
while(rs.next())
JOptionPane.showMessageDialog(null,"Total number of Books : "+rs.getInt("total"));
rs.close();
ps.close();
conn.close();
}
catch(Exception xx)
{
System.out.println(xx);
}
}
}
public static void main(String ss[])
{
bookshop oo=new bookshop();
oo.design();
oo.design1();
oo.design12();
oo.design13();
}
}
Screenshots