Repository navigation
Expand file tree
/
Copy pathUpdateSalaryFrame.java
More file actions
84 lines (56 loc) · 1.87 KB
/
Copy pathUpdateSalaryFrame.java
File metadata and controls
84 lines (56 loc) · 1.87 KB
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
package com.ems.gui.performance;
import javax.swing.*;
import java.sql.*;
import com.ems.db.DBConnection;
public class TopPerformerFrame extends JFrame {
public TopPerformerFrame() {
setTitle("Top Performer");
setSize(500,300);
setLocationRelativeTo(null);
setLayout(null);
setDefaultCloseOperation(
JFrame.DISPOSE_ON_CLOSE
);
try {
Connection con =
DBConnection.getConnection();
String query =
"select * from employee_performance "
+ "order by performance_rating desc limit 1";
PreparedStatement ps =
con.prepareStatement(query);
ResultSet rs =
ps.executeQuery();
if(rs.next()) {
JTextArea area =
new JTextArea();
area.setBounds(
30,
30,
400,
180
);
area.setText(
"Employee ID : "
+ rs.getInt("employee_id")
+ "\n\nPerformance Rating : "
+ rs.getDouble(
"performance_rating"
)
+ "\n\nPerformance Remark : "
+ rs.getString(
"performance_remark"
)
);
add(area);
}
con.close();
} catch(Exception e) {
JOptionPane.showMessageDialog(
null,
e.getMessage()
);
}
setVisible(true);
}
}