Vous êtes sur la page 1sur 15

LOGIN PAGE

String u,p;

u=t1.getText();

p=t2.getText();

try

Class.forName("java.sql.DriverManager");

Connection con;

con = DriverManager.getConnection("jdbc:mysql://localhost/BANK_MANAGEMENT","root","");

Statement stmt=con.createStatement();

String s;

s = "Select * from LOG_IN where USER_ID='"+u+"'and PASSWORD='"+p+"'";


ResultSet rs=stmt.executeQuery(s);

if(rs.next())

System.out.print("Successfully Login");

else

System.out.print("Invalid User ID And Password");

catch(ClassNotFoundException | SQLException ob)

System.out.print(ob.getMessage());

}
REGISTRATION PAGE

String a,b,c,g,h,d,e,f,I;

a=t1.getText();

b=(String) C1.getSelectedItem();

c=(String) C2.getSelectedItem();

g=(String) C3.getSelectedItem();

if(r1.isSelected())

h="MALE";

else if(r2.isSelected())

h="FEMALE";
}

else

h="NOT SELECTED";

I=t3.getText();

e=t5.getText();

f=t6.getText();

/*System.out.println(""+a);

System.out.println(""+b);

System.out.println(""+c);

System.out.println(""+g);

System.out.println(""+h);

System.out.println(""+I);

System.out.println(""+e);

System.out.println(""+f);*/

try

Class.forName("java.sql.DriverManager");

Connection con= DriverManager.getConnection


("jdbc:mysql://localhost/BANK_MANAGEMENT","root","");

Statement stmt=con.createStatement();

String s = "insert into REGISTRATION


values('"+a+"','"+b+"','"+c+"','"+g+"','"+h+"','"+I+"','"+e+"','"+f+"')";
stmt.executeUpdate(s);

System.out.print("value inserted");

catch(ClassNotFoundException | SQLException ob)

System.out.print(ob.getMessage());

}
UPDATE PAGE

{String a,b,c,g,h,e,f,I;

a=t1.getText();

b=(String) c1.getSelectedItem();

c=(String) c2.getSelectedItem();

g=(String) c3.getSelectedItem();

if(r1.isSelected())

h="MALE";

else if(r2.isSelected())

{
h="FEMALE";

else

h="NOT SELECTED";

e=t2.getText();

f=t3.getText();

I=t4.getText();

try

Class.forName("java.sql.DriverManager");

Connection con;

con = DriverManager.getConnection("jdbc:mysql://localhost/BANK_MANAGEMENT","root","");

Statement stmt=con.createStatement();

String s ;

s = "update REGISTRATION set DATE ='"+b+"', MONTH='"+c+"', YEAR='"+g+"', GENDER='"+h+"',


FATHER_NAME='"+e+"' , CONTACT_NO='"+f+"', ADDRESS='"+I+"'where NAME='"+a+"'";

stmt.executeUpdate(s);

System.out.print("updated");

catch(ClassNotFoundException | SQLException ob)


{

System.out.print(ob.getMessage());

DELETE PAGE

String i;

i=t1.getText();

String j;

j = t2.getText();

try

Class.forName("java.sql.DriverManager");

Connection con;

con = DriverManager.getConnection("jdbc:mysql://localhost/BANK_MANAGEMENT","root","");
Statement stmt=con.createStatement();

String s;

s = "delete from REGISTRATION where NAME ='"+i+"'and CONTACT_NO='"+j+"'";

stmt.executeUpdate(s);

System.out.print("deleted");

catch(ClassNotFoundException | SQLException ob)

System.out.print(ob.getMessage());

STAFF PAGES
LOGIN

String u,p;

u=t1.getText();

p=t2.getText();

try

Class.forName("java.sql.DriverManager");

Connection con;

con = DriverManager.getConnection("jdbc:mysql://localhost/BANK_MANAGEMENT","root","");

Statement stmt=con.createStatement();

String s;

s = "Select * from STAFF_LOGIN where USER_ID='"+u+"'and PASSWORD='"+p+"'";

ResultSet rs=stmt.executeQuery(s);
if(rs.next())

System.out.print("Successfully Login");

else

System.out.print("Invalid User ID And Password");

catch(ClassNotFoundException | SQLException ob)

System.out.print(ob.getMessage());
}
STAFF REGISTRATIONString a,b,c,g,h,d,e,f,I;

a=t1.getText();

b=(String) c1.getSelectedItem();

c=(String) c2.getSelectedItem();

g=(String) c3.getSelectedItem();

if(r1.isSelected())

h="MALE";

else if(r2.isSelected())

h="FEMALE";

}
else

h="NOT SELECTED";

I=t2.getText();

e=t3.getText();

f=t4.getText();

/*System.out.println(""+a);

System.out.println(""+b);

System.out.println(""+c);

System.out.println(""+g);

System.out.println(""+h);

System.out.println(""+I);

System.out.println(""+e);

System.out.println(""+f);*/

try

Class.forName("java.sql.DriverManager");

Connection con= DriverManager.getConnection


("jdbc:mysql://localhost/BANK_MANAGEMENT","root","");

Statement stmt=con.createStatement();

String s;

s = "insert into STAFF_REGISTRATION


values('"+a+"','"+b+"','"+c+"','"+g+"','"+h+"','"+I+"','"+e+"','"+f+"')";
stmt.executeUpdate(s);

System.out.print("value inserted");

catch(ClassNotFoundException | SQLException ob)

System.out.print(ob.getMessage());

Vous aimerez peut-être aussi