KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am having a variable which is: nocustomers = rs.getInt("CUST_TRAN_COUNT"); I would like to perform if it is null or not. I tried if (nocustomers ==null) It showed an error. How do I solve this? My new modified code is: 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"); } %>
Tags (comma-separated)
Save Edits
Cancel