If Statement

Posted on 2004-03-26
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?!
Question by:Pigdogmonster
  • 2

Expert Comment

ID: 10686270
Try this:

if (c == 0) {


Author Comment

ID: 10686361
I get 1 error now:- ID17013: e:\sap\SAP_J2EEngine6.20\cluster\server\services\servlet_jsp\work\jspTemp\_$SAP_J2EE_Engine_default_context\work\ 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

Accepted Solution

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");

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
trouble with PDF encryption using itext-1.3.1 17 81
grep code 4 175
excpetion with multiple catch 11 113
difference between projection and projection list in hibernate 1 102
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Introduction This article is intended for those who are new to PHP error handling (  It addresses one of the most common problems that plague beginning PHP develop…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

896 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

13 Experts available now in Live!

Get 1:1 Help Now