Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

If Statement

Posted on 2004-03-26
3
Medium Priority
?
307 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
[X]
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
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 80 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

If you’re involved with your company’s wide area network (WAN), you’ve probably heard about SD-WANs. They’re the “boy wonder” of networking, ostensibly allowing companies to replace expensive MPLS lines with low-cost Internet access. But, are they …
Whoever said that “a picture is worth one thousand words” observed a fact that can dramatically affect your marketing success. Most people tend to learn visually, so many publishers commonly acknowledge the effectiveness of visual learning by using…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

715 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