Class 12th IP Project Report
Class 12th IP Project Report
(Affiliated to C.B.S.E.)
A PROJECT REPORT ON
‘SPORTS SHOP MANAGEMENT SYSTEM’
For
AISSCE 2018-19 Examination
[As a part of the Informatics Practices Course (065)]
Place: …………….
Date: …………….
ACKNOWLEDGEMENT
1. Introduction
2. Objective and Scope of the Project
3. Theoretical Background
4. Problem Definition and Analysis
5. System Design and Development
6. Bbliography
1. Introduction
Table: item
Column Name Type Size
Item_id Integer 100
Item_name varchar 100
description Varchar 1000
price float (11,2)
Table: orderitem
Column Name Type Size
orderno varchar 100
item_id int 100
shopper_id Varchar 100
quantity int 100
Order date Date
price float (11,2)
discount Float (11,2)
amount float (11,2)
Menu Design:
JSS Infoware gateway comprises the following options,
organized in a user friendly way. The menu system
divided in Menu Bars, each having a pull down menus
containing options for a specific task.
java.awt.EventQueue.invokeLater(new }
Runnable() { });
public void run() { }
new
MainMenuUI().setVisible(true);
Frame: SHOPINUI
Coding of ShopINUI }
import java.sql.*; private void
import javax.swing.JOptionPane; btnBackActionPerformed(java.awt.event.
ActionEvent evt) {
public class ShopINUI extends
javax.swing.JFrame { this.setVisible(false);
new MainMenuUI().setVisible(true);
/** Creates new form ShopINUI */ }
public ShopINUI() { private void
btnSaveActionPerformed(java.a
initComponents();
wt.event.ActionEvent evt) { String shno =
try { txtSHno.getText().trim();
String shname =
Class.forName("com.mysql.jdbc.Driver"); txtSHName.getText();
Connection con = (Connection) String shadd =
txtSHAddress.getText();
DriverManager.getConnection("jdbc:mysql: String shcity = txtSHCity.getText();
//localhost:3306/shopkeeper","root","kvuc") double shphone =
; Double.parseDouble(txtSHPhone.getText())
Statement stmt = null; ;
ResultSet rs = null; // ResultSet if (shno.length() <= 4) {
for SHOPKEEPER table. String strSQL = "INSERT INTO
String SQL = "SELECT * FROM shopkeeper(Shopper_id, Name, Address,
shopkeeper"; City, Phone) VALUES ('"+(shno)+"','"+
(shname)+"','"+(shadd)+"','"+(shcity)+"',"+
stmt = con.createStatement(); //
(shphone)+")";
Connection string for ResultSet - rs.
rs = stmt.executeQuery(SQL);
JOptionPane.showMessageDialog(this,
"Record successfully inserted");
// Data transfer from JTextField control to
variables
int rowsEffected =
stmt.executeUpdate(strSQL);
System.out.println(rowsEffected + "
rows effected"); }
else {
JOptionPane.showMessageDialog(this, txtSHAddress.setText("");
"Customer ID should not more than 4 txtSHCity.setText("");
character.");}
txtSHPhone.setText("");}
con.close();
/**
} catch (Exception e) {
* @param args the command line
arguments
JOptionPane.showMessageDialog(this,e.get
*/
Message());
public static void main(String args[]) {
e.printStackTrace(); }
java.awt.EventQueue.invokeLater(new
}
Runnable() {
private void
public void run() {
btnClearActionPerformed(java.awt.event.A
ctionEvent evt) { new ShopINUI().setVisible(true);
}
// TODO add your handling code here:
});
txtSHno.setText("");
}
txtSHName.setText("");
Frame: ItemINUI.java
Frame: CustListUI.java
Coding of CustListUI.java
import javax.swing.table.*; * @author gagan
import java.sql.*; */
import javax.swing.JOptionPane; public class CustListUI extends
javax.swing.JFrame {
/*
* To change this template, choose Tools /** Creates new form CustListUI */
| Templates public CustListUI() {
* and open the template in the editor. initComponents();
*/ }
/*
* CustListUI.java /** This method is called from within
* the constructor to
* Created on Mar 18, 2010, 1:24:42 * initialize the form.
PM * WARNING: Do NOT modify this
*/ code. The content of this method is
* always regenerated by the Form
Editor.
/**
*/
*
@SuppressWarnings("unchecked")
// <editor-fold new Object [][] {
defaultstate="collapsed" {null, null, null, null, null},
desc="Generated Code"> {null, null, null, null, null},
private void initComponents() { {null, null, null, null, null},
{null, null, null, null, null}
jButton1 = new },
javax.swing.JButton();
new String [] {
jButton2 = new
javax.swing.JButton(); "Customer ID", "Name",
"Address", "City", "Phone"
jScrollPane1 = new
javax.swing.JScrollPane(); }
jTable1 = new ));
javax.swing.JTable();
jScrollPane1.setViewportView(jTable1);
jButton1.setFont(new getContentPane().setLayout(layout);
java.awt.Font("Tahoma", 1, 12)); //
NOI18N layout.setHorizontalGroup(
jButton1.setText("Display/Query"); layout.createParallelGroup(javax.swing.
GroupLayout.Alignment.LEADING)
jButton1.addActionListener(new
java.awt.event.ActionListener() {
.addGroup(layout.createSequentialGrou
public void p()
actionPerformed(java.awt.event.Action
Event evt) {
.addGroup(layout.createParallelGroup(j
avax.swing.GroupLayout.Alignment.LE
jButton1ActionPerformed(evt); ADING)
}
}); .addGroup(layout.createSequentialGrou
p()
jButton2.setText("Back to Menu"); .addContainerGap()
jButton2.addActionListener(new
java.awt.event.ActionListener() { .addComponent(jScrollPane1,
public void javax.swing.GroupLayout.DEFAULT_S
actionPerformed(java.awt.event.Action IZE, 587, Short.MAX_VALUE))
Event evt) {
.addGroup(layout.createSequentialGrou
jButton2ActionPerformed(evt); p()
} .addGap(171, 171, 171)
});
.addComponent(jButton1)
.addGap(38, 38, 38)
jTable1.setModel(new
javax.swing.table.DefaultTableModel(
.addComponent(jButton2)))
.addContainerGap()) String query = "SELECT * FROM
); shopkeeper";
layout.setVerticalGroup( try {
// Connect to MySQL database
layout.createParallelGroup(javax.swing.
GroupLayout.Alignment.LEADING) Class.forName("com.mysql.jdbc.Driver
").newInstance();
.addGroup(layout.createSequentialGrou Connection con = (Connection)
p() DriverManager.getConnection("jdbc:my
.addComponent(jScrollPane1, sql://localhost:3306/shopkeeper","root",
javax.swing.GroupLayout.PREFERRE "kvuc");
D_SIZE, 172, // Create SQL statement and
javax.swing.GroupLayout.PREFERRE execute query.
D_SIZE) Statement stmt =
.addGap(35, 35, 35) con.createStatement();
ResultSet rs =
.addGroup(layout.createParallelGroup(j stmt.executeQuery(query);
avax.swing.GroupLayout.Alignment.B
ASELINE) // Iterate through the result and
.addComponent(jButton1) display on screen
.addComponent(jButton2)) while (rs.next()) {
.addContainerGap(19, String Sid =
Short.MAX_VALUE)) rs.getString("Shopper_id");
); String SName =
rs.getString("Name");
pack(); String SAddress =
}// </editor-fold> rs.getString("Address");
String SCity =
rs.getString("City");
private void
jButton1ActionPerformed(java.awt.eve String SPhone =
nt.ActionEvent evt) { rs.getString("Phone");
// Before writting the followng System.out.println(Sid + "|" +
line, you should import the line: SName + "|" + SAddress + "|" + SCity +
"|" + SPhone);
// import javax.swing.table.*; at the
top of your application model.addRow(new Object[]
{Sid, SName, SAddress, SCity,
DefaultTableModel model =
SPhone});
(DefaultTableModel)
jTable1.getModel(); }
// Clear the existing table } catch (Exception e) {
int rows = model.getRowCount();
JOptionPane.showMessageDialog(this,
if (rows > 0) {
e.getMessage());
for (int i = 0; i < rows; i++) {
}
model.removeRow(0);
}
}
}
private void
// SQL Query jButton2ActionPerformed(java.awt.eve
nt.ActionEvent evt) {
this.setVisible(false);
new java.awt.EventQueue.invokeLater(new
MainMenuUI().setVisible(true); Runnable() {
} public void run() {
new
CustListUI().setVisible(true);
/**
}
* @param args the command line
arguments });
*/ }
public static void main(String args[])
{
Frame: ItemListUI.java
.addGroup(layout.createParallelGroup(j
layout.createParallelGroup(javax.swing.
avax.swing.GroupLayout.Alignment.B
GroupLayout.Alignment.LEADING)
ASELINE)
.addComponent(jButton1)
.addGroup(layout.createSequentialGrou
p() .addComponent(jButton2))
.addGroup(layout.createParallelGroup(j .addContainerGap(javax.swing.GroupL
avax.swing.GroupLayout.Alignment.LE ayout.DEFAULT_SIZE,
ADING) Short.MAX_VALUE))
);
.addGroup(layout.createSequentialGrou
p() pack();
.addContainerGap() }// </editor-fold>
.addComponent(jButton1)
private void
.addGap(38, 38, 38)
jButton1ActionPerformed(java.awt.eve
nt.ActionEvent evt) {
.addComponent(jButton2)))
// Before writting the followng
.addContainerGap()) line, you should import the line:
// import javax.swing.table.*; at the String ITid =
top of your application rs.getString("Item_id");
DefaultTableModel model = String IName =
(DefaultTableModel) rs.getString("Item_Name");
jTable1.getModel(); String IDesc =
// Clear the existing table rs.getString("Description");
int rows = model.getRowCount(); String IPrice =
if (rows > 0) { rs.getString("Price");
for (int i = 0; i < rows; i++) { System.out.println(ITid + "|"
+ IName + "|" + IDesc + "|" + IPrice);
model.removeRow(0);
model.addRow(new Object[]
}
{ITid, IName, IDesc, IPrice});
}
}
// SQL Query
} catch (Exception e) {
String query = "SELECT * FROM
Item";
JOptionPane.showMessageDialog(this,
try {
e.getMessage());
// Connect to MySQL database
}
}
Class.forName("com.mysql.jdbc.Driver
/**
").newInstance();
* @param args the command line
Connection con = (Connection)
arguments
DriverManager.getConnection("jdbc:my
sql://localhost:3306/shopkeeper","root", */
"kvuc"); public static void main(String args[])
// Create SQL statement and {
execute query.
Statement stmt = java.awt.EventQueue.invokeLater(new
con.createStatement(); Runnable() {
ResultSet rs = public void run() {
stmt.executeQuery(query); new
ItemListUI().setVisible(true);
// Iterate through the result and }
display on screen });}
while (rs.next()) {
Frame: OrdListUI.java
Coding for OrdListUI.java
import javax.swing.table.*; initComponents();
import java.sql.*; }
import javax.swing.JOptionPane;
/** This method is called from within
/* the constructor to
* To change this template, choose Tools * initialize the form.
| Templates * WARNING: Do NOT modify this
* and open the template in the editor. code. The content of this method is
*/ * always regenerated by the Form
Editor.
*/
/*
@SuppressWarnings("unchecked")
* OrdListUI.java
// <editor-fold
*
defaultstate="collapsed"
* Created on Mar 18, 2010, 1:50:20
desc="Generated Code">
PM
private void initComponents() {
*/
jButton2 = new
/**
javax.swing.JButton();
*
jButton1 = new
* @author gagan javax.swing.JButton();
*/ jScrollPane1 = new
public class OrdListUI extends javax.swing.JScrollPane();
javax.swing.JFrame { jTable1 = new
javax.swing.JTable();
/** Creates new form OrdListUI */
public OrdListUI() {
new String [] {
setDefaultCloseOperation(javax.swing. "Order No.", "Order Date",
WindowConstants.EXIT_ON_CLOSE); "Item Id", "Customer Id", "Quantity",
setTitle("List of orders"); "Price", "Discount(%)", "Amount"
}
jButton2.setText("Back to Menu"); ));
jButton2.addActionListener(new
java.awt.event.ActionListener() { jScrollPane1.setViewportView(jTable1);
public void
actionPerformed(java.awt.event.Action javax.swing.GroupLayout layout =
Event evt) { new
javax.swing.GroupLayout(getContentPa
jButton2ActionPerformed(evt); ne());
} });
getContentPane().setLayout(layout);
jButton1.setFont(new layout.setHorizontalGroup(
java.awt.Font("Tahoma", 1, 12)); //
NOI18N layout.createParallelGroup(javax.swing.
GroupLayout.Alignment.LEADING)
jButton1.setText("Display/Query");
jButton1.addActionListener(new .addGroup(layout.createSequentialGrou
java.awt.event.ActionListener() { p()
public void
actionPerformed(java.awt.event.Action .addGroup(layout.createParallelGroup(j
Event evt) { avax.swing.GroupLayout.Alignment.LE
ADING)
jButton1ActionPerformed(evt);
.addGroup(layout.createSequentialGrou
}
p()
});
.addContainerGap()
jTable1.setModel(new
.addComponent(jScrollPane1,
javax.swing.table.DefaultTableModel(
javax.swing.GroupLayout.DEFAULT_S
new Object [][] { IZE, 588, Short.MAX_VALUE))
{null, null, null, null, null,
null, null, null}, .addGroup(layout.createSequentialGrou
{null, null, null, null, null, p()
null, null, null}, .addGap(171, 171, 171)
{null, null, null, null, null,
null, null, null}, .addComponent(jButton1)
{null, null, null, null, null, .addGap(38, 38, 38)
null, null, null}
}, .addComponent(jButton2)))
.addContainerGap()) DefaultTableModel model =
); (DefaultTableModel)
jTable1.getModel();
layout.setVerticalGroup(
// Clear the existing table
layout.createParallelGroup(javax.swing. int rows = model.getRowCount();
GroupLayout.Alignment.LEADING) if (rows > 0) {
for (int i = 0; i < rows; i++) {
.addGroup(layout.createSequentialGrou model.removeRow(0);
p() } }
.addComponent(jScrollPane1, // SQL Query
javax.swing.GroupLayout.PREFERRE
String query = "SELECT * FROM
D_SIZE, 172,
orderitem";
javax.swing.GroupLayout.PREFERRE
D_SIZE) try {
.addGap(35, 35, // Connect to MySQL database
35)
.addGroup(layout.createParallelGroup(j Class.forName("com.mysql.jdbc.Driver
avax.swing.GroupLayout.Alignment.B ").newInstance();
ASELINE) Connection con = (Connection)
.addComponent(jButton1) DriverManager.getConnection("jdbc:my
.addComponent(jButton2)) sql://localhost:3306/shopkeeper","root",
"kvuc");
.addContainerGap(20,
Short.MAX_VALUE)) // Create SQL statement and
execute query.
);
Statement stmt =
pack();
con.createStatement();
}// </editor-fold>
ResultSet rs =
stmt.executeQuery(query);
private void // Iterate through the result and
jButton2ActionPerformed(java.awt.eve display on screen
nt.ActionEvent evt) {
while (rs.next()) {
this.setVisible(false);
String Ordno =
new rs.getString("Orderno");
MainMenuUI().setVisible(true);
String Ordd =
} rs.getString("OrderDate");
private void String OItemid =
jButton1ActionPerformed(java.awt.eve rs.getString("Item_Id");
nt.ActionEvent evt) {
String OSid =
// Before writting the followng rs.getString("Shopper_Id");
line, you should import the line:
String OQty =
// import javax.swing.table.*; at the rs.getString("Quantity");
top of your application
String IPrice =
rs.getString("price");
String Disc = }}
rs.getString("discount"); /**
String OAmount = * @param args the command line
rs.getString("Amount"); arguments
System.out.println(Ordno + */
"|" + Ordd + "|" +OItemid + "|" + OSid public static void main(String args[])
+ "|" + OQty + "|" + IPrice + "|" + Disc {
+ "|" + OAmount);
model.addRow(new Object[] java.awt.EventQueue.invokeLater(new
{Ordno, Ordd, OItemid, OSid, OQty, Runnable() {
IPrice, Disc, OAmount});
public void run() {
}
new
} catch (Exception e) { OrdListUI().setVisible(true); }
});
JOptionPane.showMessageDialog(this,
}
e.getMessage());
QUIT
Coding of QUIT
private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt)
{
System.exit(0); // TODO add your handling code here:
}
6. Bibliography
(1) http://www.mysql.org/
(2) http://www.netbeans.org/