//Next
f1obj=new f1();
obj.setVisible(true);
this.dispose();
//Signup
f3obj=new f3();
obj.setVisible(true);
this.dispose();
//Login
f2obj=new f2();
obj.setVisible(true);
this.dispose();
//Exit
System.exit(0);
//Back
f1obj=new f1();
obj.setVisible(true);
this.dispose();
//Submit
String e=tf1.getText();
String p=new String(pf1.getPassword());
try
{
Class.forName("java.sql.DriverManager");
Connection con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost/wwe", "root",
"mahadev");
java.sql.StatementStmt=(java.sql.Statement) con.createStatement();
String query="Select * from users where email='"+e+"' and password='"+p+"';";
ResultSetrs=Stmt.executeQuery(query);
if(rs.next())
{
f3obj=new f3();
obj.setVisible(true);
this.dispose();
}
else
JOptionPane.showMessageDialog(this,"You doesn't have a account. Pleasecreate a account");
}
catch(Exception wr)
{
JOptionPane.showMessageDialog(this,wr.getMessage());
}
//Back
f1obj=new f1();
obj.setVisible(true);
this.dispose();
//Submit
String f=tf1.getText();
String l=tf2.getText();
String e=tf3.getText();
String m=tf4.getText();
String p=new String(pf1.getPassword());
String g=null,t="User";
if (rdb1.isSelected())
g="M";
else
g="F";
try
{
Class.forName("java.sql.DriverManager");
Connection con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost/wwe", "root",
"mahadev");
Statement Stmt=(Statement) con.createStatement();
String query="insert into users values('"+f+"','"+l+"','"+e+"','"+m+"','"+p+"','"+g+"');";
Stmt.executeUpdate(query);
f2obj=new f2();
obj.setVisible(true);
this.dispose();
}
catch(Exception wr)
{
JOptionPane.showMessageDialog(this,wr.getMessage());
}
//Add Player
f5obj=new f5();
obj.setVisible(true);
this.dispose();
//Remove player
f6obj=new f6();
obj.setVisible(true);
this.dispose();
//Player info
f7obj=new f7();
obj.setVisible(true);
this.dispose();
//Add player moves
f8obj=new f8();
obj.setVisible(true);
this.dispose();
//Update moves
f9obj=new f9();
obj.setVisible(true);
this.dispose();
//Add new match
f10obj=new f10();
obj.setVisible(true);
this.dispose();
//Remove match
f11obj=new f11();
obj.setVisible(true);
this.dispose();
//Match info
f12obj=new f12();
obj.setVisible(true);
this.dispose();
//Add new belt
f13obj=new f13();
obj.setVisible(true);
this.dispose();
//Remove belt
f14obj=new f14();
obj.setVisible(true);
this.dispose();
//Add match type
f15obj=new f15();
obj.setVisible(true);
this.dispose();
//Remove match type
f16obj=new f16();
obj.setVisible(true);
this.dispose();
//Logout
f1obj=new f1();
obj.setVisible(true);
this.dispose();
//
int y= cb2.getSelectedIndex();
int m= cb3.getSelectedIndex();
int s=(Integer)sp1.getValue();
int d;
if(m==0)
{
if(s<=31&&s>0)
d=s;
else
JOptionPane.showMessageDialog(this,"Pleaseenter a valid date");
}
else if(y/4==0 && m==1)
{
if(s<=29&&s>0)
d=s;
else
JOptionPane.showMessageDialog(this,"Pleaseenter a valid date");
}
else if(y/4!=0 && m==1)
{
if(s<=29&&s>0)
d=s;
}
else if(m==2)
{
if(s<=31&&s>0)
d=s;
else
JOptionPane.showMessageDialog(this,"Pleaseenter a valid date");
}
else if(m==3)
{
if(s<=30&&s>0)
d=s;
else
JOptionPane.showMessageDialog(this,"Pleaseenter a valid date");
}
else if(m==4)
{
if(s<=31&&s>0)
d=s;
else
JOptionPane.showMessageDialog(this,"Pleaseenter a valid date");
}
else if(m==5)
{
if(s<=30&&s>0)
d=s;
else
JOptionPane.showMessageDialog(this,"Pleaseenter a valid date");
}
else if(m==6)
{
if(s<=31&&s>0)
d=s;
else
JOptionPane.showMessageDialog(this,"Pleaseenter a valid date");
}
else if(m==7)
{
if(s<=31&&s>0)
d=s;
else
JOptionPane.showMessageDialog(this,"Pleaseenter a valid date");
}
else if(m==8)
{
if(s<=30&&s>0)
d=s;
else
JOptionPane.showMessageDialog(this,"Pleaseenter a valid date");
}
else if(m==9)
{
if(s<=31&&s>0)
d=s;
else
JOptionPane.showMessageDialog(this,"Pleaseenter a valid date");
}
else if(m==10)
{
if(s<=30&&s>0)
d=s;
else
JOptionPane.showMessageDialog(this,"Pleaseenter a valid date");
}
else if(m==11)
{
if(s<=31&&s>0)
d=s;
else
JOptionPane.showMessageDialog(this,"Pleaseenter a valid date");
}
//Back
f4obj=new f4();
obj.setVisible(true);
this.dispose();
//Add player
String i=tf1.getText();
String n=tf2.getText();
String a=tf3.getText();
String y= cb2.getSelectedItem().toString();
String mo= cb3.getSelectedItem().toString();
intdit=(Integer)sp1.getValue();
String dmy=""+dit+mo+y;
try
{
Class.forName("java.sql.DriverManager");
Connection con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost/wwe", "root",
"mahadev");
Statement Stmt=(Statement) con.createStatement();
String query="insert into players values('"+i+"','"+n+"','"+a+"','"+dmy+"','null');";
Stmt.executeUpdate(query);
JOptionPane.showMessageDialog(null,"Player successfully added");
}
catch(Exception wm)
{
JOptionPane.showMessageDialog(this,wm.getMessage());
}
//Back
f4obj=new f4();
obj.setVisible(true);
this.dispose();
//Remove
inti=Integer.parseInt(tf1.getText());
try
{
Class.forName("java.sql.DriverManager");
Connection con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost/wwe", "root",
"mahadev");
Statement Stmt=(Statement) con.createStatement();
String query="delete from players where pid='"+i+"';";
Stmt.executeUpdate(query);
JOptionPane.showMessageDialog(null,"Player successfully removed");
}
catch(Exception wm)
{
JOptionPane.showMessageDialog(this,wm.getMessage());
}
//Back
f4obj=new f4();
obj.setVisible(true);
this.dispose();
//Show
DefaultTableModel m=(DefaultTableModel)t1.getModel();
int a=t1.getRowCount();
for(inti=1;i<=a;i++)
{
if(a>0)
{
m.removeRow(0);}}
try
{
Class.forName("java.sql.DriverManager");
com.mysql.jdbc.Connection
con=(com.mysql.jdbc.Connection)DriverManager.getConnection("jdbc:mysql://localhost/transport","root",
"mahadev");
com.mysql.jdbc.Statementstmt=(com.mysql.jdbc.Statement) con.createStatement();
String query="Select * from players;";
ResultSetrs=stmt.executeQuery(query);
int found=0;
while(rs.next())
{
String Pid=rs.getString("pid");
String Name=rs.getString("pname");
String Age=rs.getString("age");
String DOJ=rs.getString("DOJ");
String Moves=rs.getString("moves");
m.addRow(new Object[]{Pid, Name, Age, DOJ, Moves});found++;
}
if(found==0)
{
JOptionPane.showMessageDialog(this,"No record found");
}
}
catch (Exception wm)
{
JOptionPane.showMessageDialog(this,wm.getMessage());
}
//Back
f4obj=new f4();
obj.setVisible(true);
this.dispose();
//Add Move
String i=tf1.getText();
String n=tf2.getText();
try
{
Class.forName("java.sql.DriverManager");
Connection con=(Connection)DriverManager.getConnection("jdbc:mysql://loca lhost/wwe", "root",
"mahadev");
Statement Stmt=(Statement) con.createStatement();
String query="update players setmoves='"+n+"' where pid='"+i+"';";
Stmt.executeUpdate(query);
JOptionPane.showMessageDialog(null,"Move successfully added");
}
catch(Exception wm)
{
JOptionPane.showMessageDialog(this,wm.getMessage());
}
//Back
f4obj=new f4();
obj.setVisible(true);
this.dispose();
//Remove
inti=Integer.parseInt(tf1.getText());
String m=tf2.getText();
try
{
Class.forName("java.sql.DriverManager");
Connection con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost/wwe", "root",
"mahadev");
Statement Stmt=(Statement) con.createStatement();
String query="update players setmoves='"+m+"' where pid='"+i+"';";
Stmt.executeUpdate(query);
JOptionPane.showMessageDialog(null,"Moves successfully removed");
}
catch(Exception wm)
{
JOptionPane.showMessageDialog(this,wm.getMessage());
}
//
try
{
Class.forName("java.sql.DriverManager");
Connection con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost/wwe", "root",
"mahadev");
Statement Stmt=(Statement) con.createStatement();
String query="Select mname from match;";
ResultSetrs=Stmt.executeQuery(query);
while(rs.next())
{
cb1.addItem(rs.getString("mname"));
}
}
catch(Exception wm)
{
JOptionPane.showMessageDialog(this,wm.getMessage());
}
//
try
{
Class.forName("java.sql.DriverManager");
Connection con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost/wwe", "root",
"mahadev");
Statement Stmt=(Statement) con.createStatement();
String query="Select pname from players;";
ResultSetrs=Stmt.executeQuery(query);
while(rs.next())
{
cb2.addItem(rs.getString("pname"));
}
}
catch(Exception wm)
{
JOptionPane.showMessageDialog(this,wm.getMessage());
}
//Back
f4obj=new f4();
obj.setVisible(true);
this.dispose();
//Add Match
String i=tf1.getText();
String r=tf2.getText();
String mn=cb1.getSelectedItem().toString();
String p1=cb2.getSelectedItem().toString();
String p2=cb3.getSelectedItem().toString();
try
{
Class.forName("java.sql.DriverManager");
Connection con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost/wwe", "root",
"mahadev");
Statement Stmt=(Statement) con.createStatement();
String query="insert into matchlistvalues('"+i+"','"+mn+"','"+r+"','"+p1+"','"+p2+"');";
Stmt.executeUpdate(query);
JOptionPane.showMessageDialog(null,"Match successfully added");
}
catch(Exception wm)
{
JOptionPane.showMessageDialog(this,wm.getMessage());
}
//Back
f4obj=new f4();
obj.setVisible(true);
this.dispose();
//Remove
inti=Integer.parseInt(tf1.getText());
try
{
Class.forName("java.sql.DriverManager");
Connection con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost/wwe", "root",
"mahadev");
Statement Stmt=(Statement) con.createStatement();
String query="delete from match where mid='"+i+"';";
Stmt.executeUpdate(query);
JOptionPane.showMessageDialog(null,"Player successfully removed");
}
catch(Exception wm)
{
JOptionPane.showMessageDialog(this,wm.getMessage());
}
//Back
f4obj=new f4();
obj.setVisible(true);
this.dispose();
//Show
DefaultTableModel m=(DefaultTableModel)t1.getModel();
int a=t1.getRowCount();
for(inti=1;i<=a;i++)
{
if(a>0)
{
m.removeRow(0);}}
try
{
Class.forName("java.sql.DriverManager");
com.mysql.jdbc.Connection
con=(com.mysql.jdbc.Connection)DriverManager.getConnection("jdbc:mysql://localhost/transport","root",
"mahadev");
com.mysql.jdbc.Statementstmt=(com.mysql.jdbc.Statement) con.createStatement();
String query="Select * from matchlist;";
ResultSetrs=stmt.executeQuery(query);
int found=0;
while(rs.next())
{
String Mid=rs.getString("mid");
String Name=rs.getString("mname");
String Rname=rs.getString("rname");
String P1=rs.getString("P1");
String P2=rs.getString("P2");
m.addRow(new Object[]{Mid, Name, Rname, P1, P2});found++;
}
if(found==0)
{
JOptionPane.showMessageDialog(this,"No record found");
}
}
catch (Exception wm)
{
JOptionPane.showMessageDialog(this,wm.getMessage());
}
//Back
f4obj=new f4();
obj.setVisible(true);
this.dispose();
//Add belt
String i=tf1.getText();
String n=tf2.getText();
try
{
Class.forName("java.sql.DriverManager");
Connection con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost/wwe", "root",
"mahadev");
Statement Stmt=(Statement) con.createStatement();
String query="insert into belts values('"+i+"','"+n+"');";
Stmt.executeUpdate(query);
JOptionPane.showMessageDialog(null,"Beltsuccessfully added");
}
catch(Exception wm)
{
JOptionPane.showMessageDialog(this,wm.getMessage());
}
//Back
f4obj=new f4();
obj.setVisible(true);
this.dispose();
//Remove
inti=Integer.parseInt(tf1.getText());
try
{
Class.forName("java.sql.DriverManager");
Connection con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost/wwe", "root",
"mahadev");
Statement Stmt=(Statement) con.createStatement();
String query="delete from belts where bid='"+i+"';";
Stmt.executeUpdate(query);
JOptionPane.showMessageDialog(null,"Player successfully removed");
}
catch(Exception wm)
{
JOptionPane.showMessageDialog(this,wm.getMessage());
}
//Back
f4obj=new f4();
obj.setVisible(true);
this.dispose();
//Add match
String i=tf1.getText();
String n=tf2.getText();
try
{
Class.forName("java.sql.DriverManager");
Connection con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost/wwe", "root",
"mahadev");
Statement Stmt=(Statement) con.createStatement();
String query="insert into match values('"+i+"','"+n+"');";
Stmt.executeUpdate(query);
JOptionPane.showMessageDialog(null,"Match successfully added");
}
catch(Exception wm)
{
JOptionPane.showMessageDialog(this,wm.getMessage());
}
//Back
f4obj=new f4();
obj.setVisible(true);
this.dispose();
//Remove
inti=Integer.parseInt(tf1.getText());
try
{
Class.forName("java.sql.DriverManager");
Connection con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost/wwe", "root",
"mahadev");
Statement Stmt=(Statement) con.createStatement();
String query="delete from match where mid='"+i+"';";
Stmt.executeUpdate(query);
JOptionPane.showMessageDialog(null,"Player successfully removed");
}
catch(Exception wm)
{
JOptionPane.showMessageDialog(this,wm.getMessage());
}
Wwe Management System

Wwe Management System

  • 1.
  • 2.
    //Back f1obj=new f1(); obj.setVisible(true); this.dispose(); //Submit String e=tf1.getText(); Stringp=new String(pf1.getPassword()); try { Class.forName("java.sql.DriverManager"); Connection con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost/wwe", "root", "mahadev"); java.sql.StatementStmt=(java.sql.Statement) con.createStatement(); String query="Select * from users where email='"+e+"' and password='"+p+"';"; ResultSetrs=Stmt.executeQuery(query); if(rs.next()) { f3obj=new f3(); obj.setVisible(true); this.dispose(); } else JOptionPane.showMessageDialog(this,"You doesn't have a account. Pleasecreate a account"); } catch(Exception wr) { JOptionPane.showMessageDialog(this,wr.getMessage());
  • 3.
    } //Back f1obj=new f1(); obj.setVisible(true); this.dispose(); //Submit String f=tf1.getText(); Stringl=tf2.getText(); String e=tf3.getText(); String m=tf4.getText(); String p=new String(pf1.getPassword()); String g=null,t="User"; if (rdb1.isSelected()) g="M"; else g="F"; try { Class.forName("java.sql.DriverManager"); Connection con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost/wwe", "root", "mahadev"); Statement Stmt=(Statement) con.createStatement(); String query="insert into users values('"+f+"','"+l+"','"+e+"','"+m+"','"+p+"','"+g+"');"; Stmt.executeUpdate(query); f2obj=new f2(); obj.setVisible(true);
  • 4.
    this.dispose(); } catch(Exception wr) { JOptionPane.showMessageDialog(this,wr.getMessage()); } //Add Player f5obj=newf5(); obj.setVisible(true); this.dispose(); //Remove player f6obj=new f6(); obj.setVisible(true); this.dispose(); //Player info f7obj=new f7(); obj.setVisible(true); this.dispose(); //Add player moves f8obj=new f8(); obj.setVisible(true); this.dispose(); //Update moves f9obj=new f9(); obj.setVisible(true); this.dispose();
  • 5.
    //Add new match f10obj=newf10(); obj.setVisible(true); this.dispose(); //Remove match f11obj=new f11(); obj.setVisible(true); this.dispose(); //Match info f12obj=new f12(); obj.setVisible(true); this.dispose(); //Add new belt f13obj=new f13(); obj.setVisible(true); this.dispose(); //Remove belt f14obj=new f14(); obj.setVisible(true); this.dispose(); //Add match type f15obj=new f15(); obj.setVisible(true); this.dispose(); //Remove match type f16obj=new f16(); obj.setVisible(true); this.dispose(); //Logout f1obj=new f1(); obj.setVisible(true); this.dispose();
  • 6.
    // int y= cb2.getSelectedIndex(); intm= cb3.getSelectedIndex(); int s=(Integer)sp1.getValue(); int d; if(m==0) { if(s<=31&&s>0) d=s; else JOptionPane.showMessageDialog(this,"Pleaseenter a valid date"); } else if(y/4==0 && m==1) { if(s<=29&&s>0) d=s; else JOptionPane.showMessageDialog(this,"Pleaseenter a valid date"); } else if(y/4!=0 && m==1) { if(s<=29&&s>0) d=s; } else if(m==2)
  • 7.
    { if(s<=31&&s>0) d=s; else JOptionPane.showMessageDialog(this,"Pleaseenter a validdate"); } else if(m==3) { if(s<=30&&s>0) d=s; else JOptionPane.showMessageDialog(this,"Pleaseenter a valid date"); } else if(m==4) { if(s<=31&&s>0) d=s; else JOptionPane.showMessageDialog(this,"Pleaseenter a valid date"); } else if(m==5) { if(s<=30&&s>0) d=s; else JOptionPane.showMessageDialog(this,"Pleaseenter a valid date"); } else if(m==6) { if(s<=31&&s>0) d=s; else JOptionPane.showMessageDialog(this,"Pleaseenter a valid date");
  • 8.
    } else if(m==7) { if(s<=31&&s>0) d=s; else JOptionPane.showMessageDialog(this,"Pleaseenter avalid date"); } else if(m==8) { if(s<=30&&s>0) d=s; else JOptionPane.showMessageDialog(this,"Pleaseenter a valid date"); } else if(m==9) { if(s<=31&&s>0) d=s; else JOptionPane.showMessageDialog(this,"Pleaseenter a valid date"); } else if(m==10) { if(s<=30&&s>0) d=s; else JOptionPane.showMessageDialog(this,"Pleaseenter a valid date"); } else if(m==11) { if(s<=31&&s>0) d=s;
  • 9.
    else JOptionPane.showMessageDialog(this,"Pleaseenter a validdate"); } //Back f4obj=new f4(); obj.setVisible(true); this.dispose(); //Add player String i=tf1.getText(); String n=tf2.getText(); String a=tf3.getText(); String y= cb2.getSelectedItem().toString(); String mo= cb3.getSelectedItem().toString(); intdit=(Integer)sp1.getValue(); String dmy=""+dit+mo+y; try { Class.forName("java.sql.DriverManager"); Connection con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost/wwe", "root", "mahadev"); Statement Stmt=(Statement) con.createStatement(); String query="insert into players values('"+i+"','"+n+"','"+a+"','"+dmy+"','null');"; Stmt.executeUpdate(query); JOptionPane.showMessageDialog(null,"Player successfully added"); } catch(Exception wm) { JOptionPane.showMessageDialog(this,wm.getMessage()); }
  • 10.
    //Back f4obj=new f4(); obj.setVisible(true); this.dispose(); //Remove inti=Integer.parseInt(tf1.getText()); try { Class.forName("java.sql.DriverManager"); Connection con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost/wwe","root", "mahadev"); Statement Stmt=(Statement) con.createStatement(); String query="delete from players where pid='"+i+"';"; Stmt.executeUpdate(query); JOptionPane.showMessageDialog(null,"Player successfully removed"); } catch(Exception wm) { JOptionPane.showMessageDialog(this,wm.getMessage()); } //Back f4obj=new f4(); obj.setVisible(true); this.dispose(); //Show
  • 11.
    DefaultTableModel m=(DefaultTableModel)t1.getModel(); int a=t1.getRowCount(); for(inti=1;i<=a;i++) { if(a>0) { m.removeRow(0);}} try { Class.forName("java.sql.DriverManager"); com.mysql.jdbc.Connection con=(com.mysql.jdbc.Connection)DriverManager.getConnection("jdbc:mysql://localhost/transport","root", "mahadev"); com.mysql.jdbc.Statementstmt=(com.mysql.jdbc.Statement)con.createStatement(); String query="Select * from players;"; ResultSetrs=stmt.executeQuery(query); int found=0; while(rs.next()) { String Pid=rs.getString("pid"); String Name=rs.getString("pname"); String Age=rs.getString("age"); String DOJ=rs.getString("DOJ"); String Moves=rs.getString("moves"); m.addRow(new Object[]{Pid, Name, Age, DOJ, Moves});found++; } if(found==0) { JOptionPane.showMessageDialog(this,"No record found"); } } catch (Exception wm) { JOptionPane.showMessageDialog(this,wm.getMessage());
  • 12.
    } //Back f4obj=new f4(); obj.setVisible(true); this.dispose(); //Add Move Stringi=tf1.getText(); String n=tf2.getText(); try { Class.forName("java.sql.DriverManager"); Connection con=(Connection)DriverManager.getConnection("jdbc:mysql://loca lhost/wwe", "root", "mahadev"); Statement Stmt=(Statement) con.createStatement(); String query="update players setmoves='"+n+"' where pid='"+i+"';"; Stmt.executeUpdate(query); JOptionPane.showMessageDialog(null,"Move successfully added"); } catch(Exception wm) { JOptionPane.showMessageDialog(this,wm.getMessage()); } //Back f4obj=new f4();
  • 13.
    obj.setVisible(true); this.dispose(); //Remove inti=Integer.parseInt(tf1.getText()); String m=tf2.getText(); try { Class.forName("java.sql.DriverManager"); Connection con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost/wwe","root", "mahadev"); Statement Stmt=(Statement) con.createStatement(); String query="update players setmoves='"+m+"' where pid='"+i+"';"; Stmt.executeUpdate(query); JOptionPane.showMessageDialog(null,"Moves successfully removed"); } catch(Exception wm) { JOptionPane.showMessageDialog(this,wm.getMessage()); } // try { Class.forName("java.sql.DriverManager"); Connection con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost/wwe", "root", "mahadev"); Statement Stmt=(Statement) con.createStatement();
  • 14.
    String query="Select mnamefrom match;"; ResultSetrs=Stmt.executeQuery(query); while(rs.next()) { cb1.addItem(rs.getString("mname")); } } catch(Exception wm) { JOptionPane.showMessageDialog(this,wm.getMessage()); } // try { Class.forName("java.sql.DriverManager"); Connection con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost/wwe", "root", "mahadev"); Statement Stmt=(Statement) con.createStatement(); String query="Select pname from players;"; ResultSetrs=Stmt.executeQuery(query); while(rs.next()) { cb2.addItem(rs.getString("pname")); } } catch(Exception wm) { JOptionPane.showMessageDialog(this,wm.getMessage()); } //Back f4obj=new f4(); obj.setVisible(true); this.dispose();
  • 15.
    //Add Match String i=tf1.getText(); Stringr=tf2.getText(); String mn=cb1.getSelectedItem().toString(); String p1=cb2.getSelectedItem().toString(); String p2=cb3.getSelectedItem().toString(); try { Class.forName("java.sql.DriverManager"); Connection con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost/wwe", "root", "mahadev"); Statement Stmt=(Statement) con.createStatement(); String query="insert into matchlistvalues('"+i+"','"+mn+"','"+r+"','"+p1+"','"+p2+"');"; Stmt.executeUpdate(query); JOptionPane.showMessageDialog(null,"Match successfully added"); } catch(Exception wm) { JOptionPane.showMessageDialog(this,wm.getMessage()); } //Back f4obj=new f4(); obj.setVisible(true); this.dispose(); //Remove inti=Integer.parseInt(tf1.getText()); try { Class.forName("java.sql.DriverManager"); Connection con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost/wwe", "root", "mahadev");
  • 16.
    Statement Stmt=(Statement) con.createStatement(); Stringquery="delete from match where mid='"+i+"';"; Stmt.executeUpdate(query); JOptionPane.showMessageDialog(null,"Player successfully removed"); } catch(Exception wm) { JOptionPane.showMessageDialog(this,wm.getMessage()); } //Back f4obj=new f4(); obj.setVisible(true); this.dispose(); //Show DefaultTableModel m=(DefaultTableModel)t1.getModel(); int a=t1.getRowCount(); for(inti=1;i<=a;i++) { if(a>0) { m.removeRow(0);}} try { Class.forName("java.sql.DriverManager");
  • 17.
    com.mysql.jdbc.Connection con=(com.mysql.jdbc.Connection)DriverManager.getConnection("jdbc:mysql://localhost/transport","root", "mahadev"); com.mysql.jdbc.Statementstmt=(com.mysql.jdbc.Statement) con.createStatement(); String query="Select* from matchlist;"; ResultSetrs=stmt.executeQuery(query); int found=0; while(rs.next()) { String Mid=rs.getString("mid"); String Name=rs.getString("mname"); String Rname=rs.getString("rname"); String P1=rs.getString("P1"); String P2=rs.getString("P2"); m.addRow(new Object[]{Mid, Name, Rname, P1, P2});found++; } if(found==0) { JOptionPane.showMessageDialog(this,"No record found"); } } catch (Exception wm) { JOptionPane.showMessageDialog(this,wm.getMessage()); } //Back f4obj=new f4(); obj.setVisible(true); this.dispose();
  • 18.
    //Add belt String i=tf1.getText(); Stringn=tf2.getText(); try { Class.forName("java.sql.DriverManager"); Connection con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost/wwe", "root", "mahadev"); Statement Stmt=(Statement) con.createStatement(); String query="insert into belts values('"+i+"','"+n+"');"; Stmt.executeUpdate(query); JOptionPane.showMessageDialog(null,"Beltsuccessfully added"); } catch(Exception wm) { JOptionPane.showMessageDialog(this,wm.getMessage()); } //Back f4obj=new f4(); obj.setVisible(true); this.dispose(); //Remove inti=Integer.parseInt(tf1.getText()); try { Class.forName("java.sql.DriverManager"); Connection con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost/wwe", "root", "mahadev"); Statement Stmt=(Statement) con.createStatement();
  • 19.
    String query="delete frombelts where bid='"+i+"';"; Stmt.executeUpdate(query); JOptionPane.showMessageDialog(null,"Player successfully removed"); } catch(Exception wm) { JOptionPane.showMessageDialog(this,wm.getMessage()); } //Back f4obj=new f4(); obj.setVisible(true); this.dispose(); //Add match String i=tf1.getText(); String n=tf2.getText(); try { Class.forName("java.sql.DriverManager"); Connection con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost/wwe", "root", "mahadev"); Statement Stmt=(Statement) con.createStatement(); String query="insert into match values('"+i+"','"+n+"');"; Stmt.executeUpdate(query); JOptionPane.showMessageDialog(null,"Match successfully added"); } catch(Exception wm) { JOptionPane.showMessageDialog(this,wm.getMessage());
  • 20.
    } //Back f4obj=new f4(); obj.setVisible(true); this.dispose(); //Remove inti=Integer.parseInt(tf1.getText()); try { Class.forName("java.sql.DriverManager"); Connection con=(Connection)DriverManager.getConnection("jdbc:mysql://localhost/wwe","root", "mahadev"); Statement Stmt=(Statement) con.createStatement(); String query="delete from match where mid='"+i+"';"; Stmt.executeUpdate(query); JOptionPane.showMessageDialog(null,"Player successfully removed"); } catch(Exception wm) { JOptionPane.showMessageDialog(this,wm.getMessage()); }