0% found this document useful (0 votes)
11 views9 pages

Fee Management Report

fee management report using java ide "netbeans"

Uploaded by

Divyanshi Rajput
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views9 pages

Fee Management Report

fee management report using java ide "netbeans"

Uploaded by

Divyanshi Rajput
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Insert.

java

try

String a = t1.getText();

String b = t2.getText();

String c = t3.getText();

String d = t4.getText();

String e = t5.getText();

String f = t6.getText();

String g = t7.getText();

String h = t8.getText();

String i = t9.getText();

Class.forName("com.mysql.jdbc.Driver");
try (Connection con =
DriverManager.getConnection("jdbc:mysql://localhost:3306/personal","root","")) {

PreparedStatement pst=con.prepareStatement("insert into fee values(?,?,?,?,?,?,?,?,?)");

pst.setString(1,a);

pst.setString(2,b);

pst.setString(3,c);

pst.setString(4,d);

pst.setString(5,e);

pst.setString(6,f);

pst.setString(7,g);

pst.setString(8,h);

pst.setString(9,i);

int u= pst.executeUpdate();

if(u>0)

JOptionPane.showMessageDialog(null,"Data Inserted..","Msg",1);

} catch (SQLException ex) {

Logger.getLogger(add.class.getName()).log(Level.SEVERE, null, ex);

} catch (ClassNotFoundException ex) {

Logger.getLogger(add.class.getName()).log(Level.SEVERE, null, ex);

==========================================================================
Update.java

try

String a =t1.getText();

String b =t2.getText();

String c =t3.getText();

String d =t4.getText();

String e =t5.getText();

String f =t6.getText();

String g =t7.getText();

String h =t8.getText();

String i =t9.getText();
Class.forName("com.mysql.jdbc.Driver");

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

PreparedStatement pst=con.prepareStatement("update fee set


email=?,course=?,fees=?,paid=?,dues=?,address=?,state=?,no=? where name=?");

pst.setString(1,b);

pst.setString(2,c);

pst.setString(3,d);

pst.setString(4,e);

pst.setString(5,f);

pst.setString(6,g);

pst.setString(7,h);

pst.setString(8,i);

pst.setString(9,a);

int u=pst.executeUpdate();

if(u>0)

JOptionPane.showMessageDialog(null,"Data Updated..","Msg",1);

t1.setText("");

else

JOptionPane.showMessageDialog(null,"BookId Not Found","Msg",1);


}

catch( HeadlessException | ClassNotFoundException | SQLException ett)

JOptionPane.showMessageDialog(null,""+ett,"Msg",1);

Search.java

try

String a =t1.getText();

Class.forName("com.mysql.jdbc.Driver");
Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/personal","root","");

PreparedStatement pst=con.prepareStatement("select * from fee where name=?");

pst.setString(1,a);

ResultSet rs=pst.executeQuery();

if(rs.next())

t2.setText(rs.getString(2));

t3.setText(rs.getString(3));

t4.setText(rs.getString(4));

t5.setText(rs.getString(5));

t6.setText(rs.getString(6));

t7.setText(rs.getString(7));

t8.setText(rs.getString(8));

t9.setText(rs.getString(9));

else

JOptionPane.showMessageDialog(null,"BookId no Not Found","Msg",1);

catch( HeadlessException | ClassNotFoundException | SQLException ett)

JOptionPane.showMessageDialog(null,""+ett,"Msg",1);

}
Delete.java

try

String a = t1.getText();

Class.forName("com.mysql.jdbc.Driver");

try (Connection con =


DriverManager.getConnection("jdbc:mysql://localhost:3306/personal","root","")) {
PreparedStatement pst=con.prepareStatement("delete from fee where name=?");

pst.setString(1,a);

int u= pst.executeUpdate();

if(u>0)

JOptionPane.showMessageDialog(null,"Data Deleted..","Msg",1);

catch( HeadlessException | ClassNotFoundException | SQLException ett)

JOptionPane.showMessageDialog(null,""+ett,"Msg",1);

You might also like