Pigdogmonster
asked on
If Statement
I want to run an if Statement on a SQL count from a database:
sql34 = "select count (ShipNum) AS counter from shipData";
int c = rs34.getInt("counter");
//The count itself works fine but I want to add the following IF statement.
if (c = 0) {
Out.println("<center><font size='4' color='red'><b><i>There are no records in our database that match your search Criteria");
}
But this fails - what am I doing wrong?!
sql34 = "select count (ShipNum) AS counter from shipData";
int c = rs34.getInt("counter");
//The count itself works fine but I want to add the following IF statement.
if (c = 0) {
Out.println("<center><font
}
But this fails - what am I doing wrong?!
ASKER
I get 1 error now:-
com.inqmy.services.servlet s_jsp.serv er.jsp.Com pilingExce ption: ID17013: e:\sap\SAP_J2EEngine6.20\c luster\ser ver\servic es\servlet _jsp\work\ jspTemp\_$ SAP_J2EE_E ngine_defa ult_contex t\work\jsp _sortASC10 8030402381 2.java:879 : cannot resolve symbol
symbol : variable Out
location: class jsp_sortASC1080304023812
Out.println("There are no records in our database that match your search Criteria");
^
1 error
com.inqmy.services.servlet
symbol : variable Out
location: class jsp_sortASC1080304023812
Out.println("There are no records in our database that match your search Criteria");
^
1 error
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
if (c == 0) {
Javier