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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem with Pie chart in Jsp 20 249
getting Http 404 error in jsp forms 8 91
IE doesn't Invoke servlet in iframe 1 130
own marker interface 1 60
Invest in your employees with these five simple steps to improve employee engagement and retention.
How many times a day do you open, acknowledge, or close an IT incident? What’s your process? Do you have a process depending on the incident, systems involved, and other factors? New Relic Alerts gives you options for how you interact with notifica…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

738 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