Java Project
Java Project
The proposed system "Cricket Score Card " is utilized to get the live cricket Score update.
Main objective of the project is to develop the software for the event requirement. In this project used
to maintain the details in database so easily retrieve the details from the database. This system also
having the details of player and match are maintained in the repository management system.
As per the current work in our project we have created an interface for an admin/ match referee
or the person who update the score while having a cricket match. We made a user-friendly Graphical
User Interface which makes the user or the viewers can easily understand regarding the scores of the
match. The Data Generated during the match will be collected and saved as a record within the
MYSQL Database which may help in knowing the data of the respective match in the future. There
will be different tables that may combine the both players and the match data.
Key Features in the Project:
• List of the Players
• Striking Batsman
• Bowler to the Batsman
• Ball by Ball record
1
DEFINITIONS OF THE ELEMENTS USED IN THE PROJECT:
1. SWINGS:
Java Swings is a part of Java Foundation Classes (JFC) that is used to create window-based
applications.
It is built on the top of AWT (Abstract Windowing Toolkit) API and entirely written in java.
Unlike AWT, Java Swing provides platform-independent and lightweight components.
The javax.swing package provides classes for java swing API such as JButton, JTextField,
JTextArea, JRadioButton, JCheckbox, JMenu, JColorChooser etc.
2
These are the Java Swing API’s that we used in our project:
Java JFrame
Java JButton
Java JCheckBox
Java JLabel
3
Java JTextField
Java JRadioButton
2. JDBC Driver:
To connect Java application with the MySQL database, we need to follow 4 following steps.In this
Project we used MySql as the database. So we need to know following informations for the mysql
database:
Driver class: The driver class for the mysql database is com.mysql.jdbc.Driver.
Connection URL: The connection URL for the mysql database
is jdbc:mysql://localhost:3306/database_name
where jdbc is the API, mysql is the database, localhost is the server name on which mysql is
running, we may also use IP address, 3306 is the port number and CricketData is the database
name. We may use any database, in such case, we need to replace the CricketData with our
database name.
In our Project we have used the JDBC Driver to Connect the Java program to a Database
4
Packages:
A java package is a group of similar types of classes, interfaces and sub-packages.Package in java can
be categorized in two form, built-in package and user-defined package.There are many built-in packages
such as java, lang, awt, javax, swing, net, io, util, sql etc.
1) Java package is used to categorize the classes and interfaces so that they can be easily maintained.
In our Project we have created a package called Cricket_Score and Saved all the .class , .java files into
that package.
5
DESIGN
3.1 Screens
ScoreCard
6
IMPLEMENTATION
4.1 Code:
4.1.1 Tosspage Code:
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.JTextField;
import javax.swing.JRadioButton;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
7
{
setTitle("TossPage");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 444, 408);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
8
contentPane.add(overs);
Overs.setColumns(10);
Overs.setBounds(146, 108, 157, 17);
contentPane.add(Overs);
9
JRadioButton bowlopt = new JRadioButton("Bowl");
bowlopt.setFont(new Font("Times New Roman", Font.PLAIN, 12));
bowlopt.setBounds(146, 274, 113, 21);
contentPane.add(bowlopt);
JButton start = new JButton("Start Match");
start.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
matchDetails md=new matchDetails();
try
{
boolean z=team1toss.isSelected();
boolean y=batopt.isSelected();
md.setData(team1.getText(),team2.getText(),Overs.getText(),z,y);
System.out.println();
}
catch (Exception e1)
{
e1.printStackTrace();
}
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Player_Entry frame = new
Player_Entry(team1.getText(),team2.getText());
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
tossFrame.setVisible(false);
10
}
});
start.setFont(new Font("Times New Roman", Font.BOLD, 12));
start.setBounds(146, 314, 113, 34);
contentPane.add(start);
}
}
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
public class matchDetails{
public void setData(String Team1,String Team2,String overs,boolean t1toss,boolean optbat)
throws Exception{
try{
int k=Integer.parseInt(overs);
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/cricket","root","Abhilash@213");
Statement stmt=con.createStatement();
String toss;
toss=Team1;
if(!t1toss)
toss=Team2;
String opt="bat";
if(!optbat)
opt="bowl";
stmt.execute("insert into cricket.match(team1,team2,toss,opt,overs)
values('"+Team1+"','"+Team2+"','"+toss+"','"+opt+"',"+k+");");
con.close();
}
catch(Exception e){
System.out.println(e);}
}
}
11
4.1.2 PlayerEntry Code:
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.JTextField;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
12
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 710, 546);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
13
nonstrike.setFont(new Font("Times New Roman", Font.PLAIN, 16));
nonstrike.setColumns(10);
contentPane.add(nonstrike);
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
ScoreCard window = new
ScoreCard(strike.getText(),nonstrike.getText(),open.getText(),t1,t2);
window.Frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
14
}
}
});
temp.setVisible(false);
}
});
start.setFont(new Font("Times New Roman", Font.BOLD, 16));
contentPane.add(start);
}
}
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
public class database{
public void setData(String pname,String runs,String balls,String four,String six) throws
Exception
{
try
{
Class.forName("com.mysql.cj.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/cricket","root","Abhilash@213");
Statement stmt=con.createStatement();
stmt.execute("insert into cricket.bat(batname,runs,balls,four,six)
values('"+pname+"','"+runs+"','"+balls+"','"+four+"','"+six+"');");
con.close();
}
catch(Exception e)
{
System.out.println(e);
}
}
}
15
4.1.3 ScoreCard Code:
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.JTextField;
import javax.swing.JCheckBox;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.SwingConstants;
public class ScoreCard
{
public JFrame Frame;
private JTextField runs;
private JTextField wickets;
private JTextField over;
private JTextField ball;
private JTextField batsman1;
private JTextField runs1;
private JTextField balls1;
private JTextField four1;
private JTextField six1;
private JTextField strikerate1;
private JTextField batsman2;
private JTextField runs2;
private JTextField balls2;
private JTextField four2;
private JTextField six2;
private JTextField strikerate2;
private JTextField strike;
private JTextField b1;
private JTextField b2;
private JTextField b3;
16
private JTextField b4;
private JTextField b5;
private JTextField b6;
private JTextField b7;
private JTextField b8;
private JTextField b9;
private JTextField b10;
private JLabel lblNewLabel_1_1_3;
private JCheckBox wide;
private JCheckBox noball;
private JCheckBox byes;
private JCheckBox legbyes;
private JCheckBox wicket;
private JButton one;
private JButton two;
private JButton three;
private JButton four;
private JButton five;
private JButton six;
private int ballCount=0;
private String k1,k2,k3;
private JTextField bowler;
private JTextField overs;
private JTextField maiden;
private String t1=null;
private String t2=null;
private JTextField runsb;
private JTextField wicketsb;
private JTextField economy;
private JLabel lblNewLabel_1_1_5;
private JTextField textField;
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
17
try {
ScoreCard window = new ScoreCard(null,null,null,null,null);
window.Frame.setVisible(true);
}
catch (Exception e)
{
e.printStackTrace();
}
}
});
}
public ScoreCard(String k1,String k2,String k3,String t1,String t2){
this.k1=k1;
this.k2=k2;
this.k3=k3;
this.t1=t1;
this.t2=t2;
initialize();
}
private void initialize() {
Frame = new JFrame();
Frame.setBounds(100, 100, 613, 549);
Frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Frame.getContentPane().setLayout(null);
Frame.setTitle("ScoreCard");
if(t1!=null) {
JLabel match = new JLabel(t1+" vs "+t2);
match.setHorizontalAlignment(SwingConstants.CENTER);
match.setBounds(36, 10, 519, 38);
match.setFont(new Font("Times New Roman", Font.BOLD, 22));
Frame.getContentPane().add(match);
}
JLabel lblNewLabel_1 = new JLabel("Batsman");
lblNewLabel_1.setBounds(36, 147, 94, 28);
18
lblNewLabel_1.setFont(new Font("Times New Roman", Font.PLAIN, 13));
Frame.getContentPane().add(lblNewLabel_1);
JLabel lblNewLabel_1_1 = new JLabel("Runs");
lblNewLabel_1_1.setBounds(242, 147, 49, 28);
lblNewLabel_1_1.setFont(new Font("Times New Roman", Font.PLAIN, 13));
Frame.getContentPane().add(lblNewLabel_1_1);
19
wickets = new JTextField();
wickets.setFont(new Font("Times New Roman", Font.BOLD, 23));
wickets.setEditable(false);
wickets.setHorizontalAlignment(SwingConstants.CENTER);
wickets.setBounds(135, 84, 65, 38);
wickets.setColumns(10);
Frame.getContentPane().add(wickets);
20
ball.setEditable(false);
ball.setHorizontalAlignment(SwingConstants.CENTER);
ball.setBounds(307, 84, 29, 38);
ball.setColumns(10);
Frame.getContentPane().add(ball);
21
four1.setText("0");
four1.setFont(new Font("Times New Roman", Font.BOLD, 15));
four1.setBounds(364, 184, 29, 28);
four1.setColumns(10);
Frame.getContentPane().add(four1);
six1 = new JTextField();
six1.setBorder(null);
six1.setEditable(false);
six1.setText("0");
six1.setFont(new Font("Times New Roman", Font.BOLD, 15));
six1.setBounds(407, 184, 33, 28);
six1.setColumns(10);
Frame.getContentPane().add(six1);
22
runs2.setBounds(242, 223, 49, 28);
runs2.setColumns(10);
Frame.getContentPane().add(runs2);
23
strikerate2.setText("0");
strikerate2.setFont(new Font("Times New Roman", Font.BOLD, 15));
strikerate2.setBounds(461, 223, 70, 28);
strikerate2.setColumns(10);
Frame.getContentPane().add(strikerate2);
strike = new JTextField();
strike.setHorizontalAlignment(SwingConstants.RIGHT);
strike.setFont(new Font("Times New Roman", Font.BOLD, 16));
strike.setBounds(6, 184, 20, 28);
strike.setColumns(10);
Frame.getContentPane().add(strike);
b1 = new JTextField();
b1.setHorizontalAlignment(SwingConstants.CENTER);
b1.setFont(new Font("Times New Roman", Font.BOLD, 15));
b1.setEditable(false);
b1.setBounds(111, 358, 33, 38);
b1.setColumns(10);
Frame.getContentPane().add(b1);
b2 = new JTextField();
b2.setHorizontalAlignment(SwingConstants.CENTER);
b2.setFont(new Font("Times New Roman", Font.BOLD, 15));
b2.setEditable(false);
b2.setBounds(154, 358, 33, 38);
b2.setColumns(10);
Frame.getContentPane().add(b2);
b3 = new JTextField();
b3.setHorizontalAlignment(SwingConstants.CENTER);
b3.setFont(new Font("Times New Roman", Font.BOLD, 15));
b3.setEditable(false);
b3.setBounds(197, 358, 33, 38);
b3.setColumns(10);
24
Frame.getContentPane().add(b3);
b4 = new JTextField();
b4.setHorizontalAlignment(SwingConstants.CENTER);
b4.setFont(new Font("Times New Roman", Font.BOLD, 15));
b4.setEditable(false);
b4.setBounds(242, 358, 33, 38);
b4.setColumns(10);
Frame.getContentPane().add(b4);
b5 = new JTextField();
b5.setHorizontalAlignment(SwingConstants.CENTER);
b5.setFont(new Font("Times New Roman", Font.BOLD, 15));
b5.setEditable(false);
b5.setBounds(285, 358, 33, 38);
b5.setColumns(10);
Frame.getContentPane().add(b5);
b6 = new JTextField();
b6.setHorizontalAlignment(SwingConstants.CENTER);
b6.setFont(new Font("Times New Roman", Font.BOLD, 15));
b6.setEditable(false);
b6.setBounds(328, 358, 33, 38);
b6.setColumns(10);
Frame.getContentPane().add(b6);
b7 = new JTextField();
b7.setHorizontalAlignment(SwingConstants.CENTER);
b7.setFont(new Font("Times New Roman", Font.BOLD, 15));
b7.setEditable(false);
b7.setBounds(371, 358, 33, 38);
b7.setColumns(10);
Frame.getContentPane().add(b7);
b8 = new JTextField();
25
b8.setHorizontalAlignment(SwingConstants.CENTER);
b8.setFont(new Font("Times New Roman", Font.BOLD, 15));
b8.setEditable(false);
b8.setBounds(414, 358, 33, 38);
b8.setColumns(10);
Frame.getContentPane().add(b8);
b9 = new JTextField();
b9.setHorizontalAlignment(SwingConstants.CENTER);
b9.setFont(new Font("Times New Roman", Font.BOLD, 15));
b9.setEditable(false);
b9.setBounds(461, 358, 33, 38);
b9.setColumns(10);
Frame.getContentPane().add(b9);
26
noball.setBounds(111, 406, 65, 21);
Frame.getContentPane().add(noball);
27
{
scoreConvert(1,wicket.isSelected(),wide.isSelected(),noball.isSelected());
SetButton("1",wide.isSelected(),noball.isSelected());
}
});
one.setFont(new Font("Times New Roman", Font.BOLD, 28));
one.setBounds(111, 433, 66, 66);
Frame.getContentPane().add(one);
two = new JButton("2");
two.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
scoreConvert(2,wicket.isSelected(),wide.isSelected(),noball.isSelected());
SetButton("2",wide.isSelected(),noball.isSelected());
}
});
two.setFont(new Font("Times New Roman", Font.BOLD, 28));
two.setBounds(187, 433, 65, 66);
Frame.getContentPane().add(two);
28
SetButton("4",wide.isSelected(),noball.isSelected());
}
});
four.setFont(new Font("Times New Roman", Font.BOLD, 28));
four.setBounds(337, 433, 60, 66);
Frame.getContentPane().add(four);
29
JLabel lblNewLabel_1_1_4 = new JLabel("Overs");
lblNewLabel_1_1_4.setFont(new Font("Times New Roman", Font.PLAIN, 13));
lblNewLabel_1_1_4.setBounds(242, 272, 49, 28);
Frame.getContentPane().add(lblNewLabel_1_1_4);
30
overs.setText("0");
overs.setFont(new Font("Times New Roman", Font.BOLD, 15));
overs.setColumns(10);
overs.setBounds(262, 310, 20, 28);
Frame.getContentPane().add(overs);
31
economy.setEditable(false);
economy.setText("0");
economy.setFont(new Font("Times New Roman", Font.BOLD, 15));
economy.setColumns(10);
economy.setBounds(482, 310, 49, 28);
Frame.getContentPane().add(economy);
batsman1.setText(k1);
batsman2.setText(k2);
bowler.setText(k3);
batsman1.setEditable(false);
batsman1.setBorder(null);
batsman2.setEditable(false);
batsman2.setBorder(null);
bowler.setEditable(false);
bowler.setBorder(null);
runs.setText("0");
wickets.setText("0");
over.setText("0");
ball.setText("0");
strike.setEditable(false);
strike.setBorder(null);
runs.setBorder(null);
over.setBorder(null);
ball.setBorder(null);
wickets.setBorder(null);
lblNewLabel_1_1_5 = new JLabel("Overs");
lblNewLabel_1_1_5.setFont(new Font("Times New Roman", Font.PLAIN, 16));
lblNewLabel_1_1_5.setBounds(242, 46, 55, 28);
Frame.getContentPane().add(lblNewLabel_1_1_5);
32
textField.setHorizontalAlignment(SwingConstants.CENTER);
textField.setFont(new Font("Times New Roman", Font.BOLD, 25));
textField.setEditable(false);
textField.setColumns(10);
textField.setBounds(282, 83, 20, 38);
textField.setBorder(null);
Frame.getContentPane().add(textField);
33
u.setData(bowler.getText(),overs.getText(), runsb.getText(),
maiden.getText(), wicketsb.getText());
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
b1.setText("");
b2.setText("");
b3.setText("");
b4.setText("");
b5.setText("");
b6.setText("");
b7.setText("");
b8.setText("");
b9.setText("");
b10.setText("");
ballCount=0;
}
if(b1.getText()==null || b1.getText().trim().equals(""))
{
b1.setText(bno);
if(wide==true || noball==true)
{
ballCount--;
if(wide==true)
b1.setText("WD");
else
b1.setText("NB");
}
if(wicket.isSelected()==true)
{
b1.setText("OUT");
34
}
}
else if(b2.getText()==null || b2.getText().trim().equals(""))
{
b2.setText(bno);
if(wide==true || noball==true)
{
ballCount--;
if(wide==true)
b2.setText("WD");
else
b2.setText("NB");
}
if(wicket.isSelected()==true)
{
b2.setText("OUT");
}
}
else if(b3.getText()==null || b3.getText().trim().equals(""))
{
b3.setText(bno);
if(wide==true || noball==true)
{
ballCount--;
if(wide==true)
b3.setText("WD");
else
b3.setText("NB");
}
if(wicket.isSelected()==true)
{
b3.setText("OUT");
}
35
}
else if(b4.getText()==null || b4.getText().trim().equals(""))
{
b4.setText(bno);
if(wide==true || noball==true)
{
ballCount--;
if(wide==true)
b4.setText("WD");
else
b4.setText("NB");
}
if(wicket.isSelected()==true)
{
b4.setText("OUT");
}
}
else if(b5.getText()==null || b5.getText().trim().equals(""))
{
b5.setText(bno);
if(wide==true || noball==true)
{
ballCount--;
if(wide==true)
b5.setText("WD");
else
b5.setText("NB");
}
if(wicket.isSelected()==true)
{
b5.setText("OUT");
}
}
else if(b6.getText()==null || b6.getText().trim().equals(""))
36
{
b6.setText(bno);
if(wide==true || noball==true)
{
ballCount--;
if(wide==true)
b6.setText("WD");
else
b6.setText("NB");
}
if(wicket.isSelected()==true)
{
b6.setText("OUT");
}
}
else if(b7.getText()==null || b7.getText().trim().equals(""))
{
b7.setText(bno);
if(wide==true || noball==true)
{
ballCount--;
if(wide==true)
b7.setText("WD");
else
b7.setText("NB");
}
if(wicket.isSelected()==true)
{
b7.setText("OUT");
}
}
else if(b8.getText()==null || b8.getText().trim().equals(""))
{
b8.setText(bno);
37
if(wide==true || noball==true)
{
ballCount--;
if(wide==true)
b8.setText("WD");
else
b8.setText("NB");
}
if(wicket.isSelected()==true)
{
b8.setText("OUT");
}
}
else if(b9.getText()==null || b9.getText().trim().equals(""))
{
b9.setText(bno);
if(wide==true || noball==true)
{
ballCount--;
if(wide==true)
b9.setText("WD");
else
b9.setText("NB");
}
if(wicket.isSelected()==true)
{
b9.setText("OUT");
}
}
else if(b10.getText()==null || b10.getText().trim().equals(""))
{
b10.setText(bno);
if(wide==true || noball==true)
{
38
ballCount--;
if(wide==true)
b10.setText("WD");
else
b10.setText("NB");
}
if(wicket.isSelected()==true)
{
b10.setText("OUT");
}
}
ballCount++;
}
public boolean flag1=true;
private JTextField textField_1;
private JTextField textField_2;
public void bowlerchange(String x)
{
bowler.setText(x);
initialize();
}
int change(String temp){
int t;
t=Integer.parseInt(temp);
return t;
}
public void scoreConvert(int i,boolean wt,boolean wi,boolean no)
{
int ss=change(overs.getText());
ss=ss+1;
overs.setText(String.valueOf(ss));
int y=change(runsb.getText());
y=y+i;
39
runsb.setText(String.valueOf(y));
if(y!=0)
{
float ii=((float)(ss/y))*6;
economy.setText(String.valueOf(ii));
}
strike.setText("*");
pop obj=new pop();
boolean ext=false;
if(wi==true || no==true)
ext=true;
obj.SqlGet(i, wt,ext,batsman1.getText(),bowler.getText());
if(wt==true)
{
y=change(wicketsb.getText());
y=y+1;
wicketsb.setText(String.valueOf(y));
database bb=new database();
try
{
bb.setData(batsman1.getText(), runs1.getText(),
balls1.getText(),four1.getText() , six1.getText());
}
catch (Exception e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
int z=Integer.parseInt(wickets.getText());
z++;
40
String s=String.valueOf(z);
wickets.setText(s);
runs1.setText("0");
four1.setText("0");
six1.setText("0");
strikerate1.setText("0");
balls1.setText("-1");
newbat obj1=new newbat();
obj1.main(null);
}
int z=Integer.parseInt(runs.getText());
int k=z+i;
if(wi==true || no==true)
k++;
String s=String.valueOf(k);
runs.setText(s);
if(i==4)
{
int l=Integer.parseInt(four1.getText());
l=l+1;
four1.setText(String.valueOf(l));
}
if(i==6){
int a=Integer.parseInt(six1.getText());
a=a+1;
six1.setText(String.valueOf(a));
}
int a;
41
if(wi==false && no==false)
{
a=Integer.parseInt(runs1.getText());
a=a+i;
runs1.setText(String.valueOf(a));
int b=Integer.parseInt(balls1.getText());
b=b+1;
balls1.setText(String.valueOf(b));
z=Integer.parseInt(ball.getText());
z++;
if(z==6)
{
z=0;
int d=Integer.parseInt(over.getText());
d++;
String j=String.valueOf(d);
over.setText(j);
}
ball.setText(String.valueOf(z));
}
if(i%2!=0)
{
String tempp;
String runs;
String balls;
String fours;
String sixes;
tempp=batsman1.getText();
runs=runs1.getText();
balls=balls1.getText();
fours=four1.getText();
sixes=six1.getText();
batsman1.setText(batsman2.getText());
runs1.setText(runs2.getText());
42
balls1.setText(balls2.getText());
four1.setText(four2.getText());
six1.setText(six2.getText());
batsman2.setText(tempp);
runs2.setText(runs);
balls2.setText(balls);
four2.setText(fours);
six2.setText(sixes);
}
int o=Integer.parseInt(runs1.getText());
int p=Integer.parseInt(balls1.getText());
if(p!=0)
strikerate1.setText(String.valueOf((((float)o)/p)*100));
o=Integer.parseInt(runs2.getText());
p=Integer.parseInt(balls2.getText());
if(p!=0)
strikerate2.setText(String.valueOf((((float)o)/p)*100));
}
}
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
public class pop
{
void SqlGet(int score,boolean wkt,boolean extra,String bat1,String bowler){
try {
Class.forName("com.mysql.cj.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/cricket","root","Abhilash@213");
int wicket=0;
int ext=0;
if(wkt==true)
43
wicket=1;
if(extra==true)
ext=1;
String query = "insert into
match_(matchid,score,isout,extra,batterid,bowlerid,innings)
values(1,"+score+","+wicket+","+ext+",'"+bat1+"','"+bowler+"',1)";
Statement stk=con.createStatement();
stk.execute(query);
System.out.println("SuccessFully Entered into Database");
}
catch (Exception e1)
{
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
}
44
RESULT SCREENS
Tosspage Screen
Player Entry Page (Redirects to this page after submitting the above page)
45
ScoreCard (After Clicking on Start Match Button ,it redirects to this interface)
46
Batsman Out Scenario (will get a new Interaface to provide the New Batsman name)
47
Ball By Ball Record of the match
48
CONCLUSION
It is concluded that the application works well and satisfy the end users. The application is tested very well and
errors are properly debugged. We have checked all the possible test cases to avoid the errors or any exceptions.
This system is user friendly so everyone can use easily. Proper documentation is provided. The end user can
easily understand how the whole system is implemented by going through the documentation. The system is
tested, implemented and the performance is found to be satisfactory. All necessary output is generated. Thus, the
project is completed successfully. Further enhancements can be made to the application, so that the application
functions very attractive and useful manner than the present one.
49
FUTURE SCOPE
There is scope for future development of this project. The world of computer fields is not static; it is always
subject to be dynamic. The technology which is famous today becomes outdated the very next day. To keep
abstract of technical improvements, the system may be further refined. So, it is not concluded. Yet it will improve
with further enhancements. Enhancements can be done in an efficient manner. We can even update the same with
further modification establishment and can be integrated with minimal modification. Thus the project is flexible
and can be enhanced at any time with more advanced features.
Future Enhancements:
Player wise Details
Previous Match Details
Head-to-Head Encounter(teams)
Stats of (Player vs Player)
Ball by Ball Commentary
Necessary Graphics such as Graphs for run rate, Economy etc...
Providing an end User interface
50