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?!
PigdogmonsterAsked:
Who is Participating?
 
jarasaConnect With a Mentor Commented:
Sorry I didn't saw that

out.println("There are no records in our database that match your search Criteria");
       
Javier
0
 
jarasaCommented:
Try this:

if (c == 0) {

Javier
0
 
PigdogmonsterAuthor Commented:
I get 1 error now:-

com.inqmy.services.servlets_jsp.server.jsp.CompilingException: ID17013: e:\sap\SAP_J2EEngine6.20\cluster\server\services\servlet_jsp\work\jspTemp\_$SAP_J2EE_Engine_default_context\work\jsp_sortASC1080304023812.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
0
All Courses

From novice to tech pro — start learning today.