title: Check an int variable is null or is empty from the Database
body: <p>I am having a variable which is:</p>
  
  <pre><code>nocustomers = rs.getInt("CUST_TRAN_COUNT");
  </code></pre>
  
  <p>I would like to perform if it is null or not.</p>
  
  <p>I tried </p>
  
  <pre><code>if (nocustomers ==null)
  </code></pre>
  
  <p>It showed an error.</p>
  
  <p>How do I solve this?</p>
  
  <hr>
  
  <p>My new modified code is:</p>
  
  <pre><code>try{
  
      query=" select * from SS_summary where txn_date = to_date ('"+asatdate+"','YYYY-MM-DD') ";
      st = conn.createStatement();
      rs = st.executeQuery(query);
  
      if (rs.next())
      {   
  
  
      nocustomers = rs.getInt("CUST_TRAN_COUNT");
  
      nocheques =rs.getInt("CHEQ_DELIVERED_MAIN");
      }
  
      if (rs.wasNull()) {
          out.println("NO DATA FOUND");
          }
  
  %&gt;
  </code></pre>