Total Employees
<%= rowCount %>
<%
int row = 0; // Declaring rowCount outside try block
try {
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/CLINIHR", "root", "Clinica123");
Statement st = con.createStatement();
ResultSet rs = st.executeQuery("SELECT COUNT(*) AS row_count FROM leave_app");
while (rs.next()) {
row = rs.getInt("row_count");
}
} catch (Exception e) {
out.println(e);
}
%>
Leave Applications
<%= row %>
<%
int rowLM = 0; // Declaring rowCount outside try block
try {
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/CLINIHR", "root", "Clinica123");
Statement st = con.createStatement();
ResultSet rs = st.executeQuery("SELECT COUNT(*) AS row_count FROM users where role='Line Manager'");
while (rs.next()) {
rowLM = rs.getInt("row_count");
}
} catch (Exception e) {
out.println(e);
}
%>
Line Managers
<%= rowLM %>