I am developing a Java web application in NETBEANS and I have a query which shows numerical values only, when I execute my query it shows them in an organized table, everything works perfectly.
What I want to do are 3 conditions "IF" with the values that I pull from my Database:
- If the values are less than 50 the values are painted red.
- If the values are greater than 50 but less than 95 are painted orange.
- If the values are greater than 96, they are painted green.
It is the final part of my development and I would really help your help, Thank you very much.
I leave the code of my query below.
The rs.getString()
are the values of the query.
<%
consulta conexion = new consulta ("jdbc:oracle:thin:@localhost:1521:XE","pasaportes","oppasaportes");
String consulta = "SELECT DELEGACION, id_delegacion, CONTRATO , prerequisitos_tecnologicos, equipamiento, sistema_operacion, privilegios, capacitacion, citas FROM delegaciones";
ResultSet rs = conexion.ejeSelect(consulta);
ResultSetMetaData rsmd = rs.getMetaData();
int col= rsmd.getColumnCount();
for(int k=1;k<=col;k++){
%>
<td><h9> <%= rsmd.getColumnName(k) %></h9></td>
<%
}
%>
</tr>
<%
while(rs.next()){
%>
<tr>
<td><h6><%= rs.getString(1) %></h6> </td>
<td><h6><%= rs.getString(2) %></h6> </td>
<td><h6><%= rs.getString(3) %></h6> </td>
<td><h6><%= rs.getString(4) %></h6> </td>
<td><h6><%= rs.getString(5) %></h6> </td>
<td><h6><%= rs.getString(6) %></h6> </td>
<td><h6><%= rs.getString(7) %></h6> </td>
<td><h6><%= rs.getString(8) %></h6> </td>
<td><h6><%= rs.getString(9) %></h6> </td>
</tr>
<%
}
%>