Solved

If Statement

Posted on 2004-03-26
3
302 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Export JSON response data to Excel in IE9 3 81
squirrelPlay java challenge 40 158
lessBy10  challenge 15 95
instanceof  operator in java 26 96
There's a lot of hype surrounding blockchain technology. Here's how it works and some of the novel ways it' s now being used - including for data protection.
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

827 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