-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoutput.java
88 lines (70 loc) · 2.71 KB
/
output.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import javax.swing.*;
import java.sql.ResultSet;
public class output extends JFrame {
output(String StudentID){
JFrame f1=new JFrame();
f1.setTitle("Student Info");
f1.setLayout(null);
JLabel n = new JLabel("Name:");
n.setBounds(20, 20, 100, 30);
f1.add(n);
JLabel name = new JLabel();
name.setBounds(200, 20, 100, 30);
f1.add(name);
JLabel a = new JLabel("Admission date:");
a.setBounds(20, 60, 100, 30);
f1.add(a);
JLabel admission = new JLabel();
admission.setBounds(200, 60, 100, 30);
f1.add(admission);
JLabel f = new JLabel("Fees:");
f.setBounds(20, 100, 100, 30);
f1.add(f);
JLabel fees = new JLabel();
fees.setBounds(200, 100, 100, 30);
f1.add(fees);
JLabel P = new JLabel("Pass in Semester's:");
P.setBounds(20, 140, 150, 30);
f1.add(P);
JLabel Pass = new JLabel();
Pass.setBounds(200, 140, 100, 30);
f1.add(Pass);
JLabel K = new JLabel("KT in semester's:");
K.setBounds(20, 180, 100, 30);
f1.add(K);
JLabel Kt = new JLabel();
Kt.setBounds(200, 180, 100, 30);
f1.add(Kt);
try {
Conn c = new Conn();
ResultSet rs = c.s.executeQuery("select * from studinfo where studid='"+StudentID+"'");
while (rs.next()) {
name.setText( name.getText() + "<html>" +" " +rs.getString("name"));
}
ResultSet r = c.s.executeQuery("select * from studinfo where studid='"+StudentID+"'");
while (r.next()) {
admission.setText( admission.getText() + "<html>" +" " +r.getString("admission"));
}
ResultSet s = c.s.executeQuery("select * from studinfo where studid='"+StudentID+"'");
while (s.next()) {
fees.setText( fees.getText() + "<html>" +" " +s.getString("fees"));
}
ResultSet sr = c.s.executeQuery("select * from studinfo where studid='"+StudentID+"'");
while (sr.next()) {
Pass.setText( Pass.getText() + "<html>" +" " +sr.getString("pass"));
}
ResultSet rr = c.s.executeQuery("select * from studinfo where studid='"+StudentID+"'");
while (rr.next()) {
Kt.setText( Kt.getText() + "<html>" +" " +rr.getString("kt"));
}
} catch (Exception e) {
System.out.println(e);
}
f1.setSize(400, 300);
f1.setLocation(570, 200);
f1.setVisible(true);
}
public static void main(String[] args) {
new output(" ");
}
}