Solved

If Statement

Posted on 2004-03-26
3
299 Views
Last Modified: 2010-04-01
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?!
0
Comment
Question by:Pigdogmonster
  • 2
3 Comments
 
LVL 6

Expert Comment

by:jarasa
ID: 10686270
Try this:

if (c == 0) {

Javier
0
 

Author Comment

by:Pigdogmonster
ID: 10686361
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
 
LVL 6

Accepted Solution

by:
jarasa earned 20 total points
ID: 10686411
Sorry I didn't saw that

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

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

In this article, I show you step by step with screenshots to assist you - HOW TO: Deploy and Install the VMware vCenter Server Appliance 6.5 (VCSA 6.5), with some helpful tips along the way.
For cloud, the “train has left the station” and in the Microsoft ERP & CRM world, that means the next generation of enterprise software from Microsoft is here: Dynamics 365 is Microsoft’s new integrated business solution that unifies CRM and ERP fun…
This video discusses moving either the default database or any database to a new volume.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now