java - Null pointer exception in an if statement in JSP? -


i have jsp program deducts stocks given user input. there 3 branches available (example b1, b2, , b3). form given user ask item code, branch borrow , number of stocks borrowed. connected database update tables after deduction.

i have if statement compares user's choice of branch borrow , real branch determine query executed.

i no errors until go update form says have nullpointerexception on if statement. i've been trying solutions nothing seems me solve problem.

it appreciated if me on one. here's code if statement.

    if (strbranch.equals("binangonan")) {        ps_binang.executeupdate();        ps_aupdate.executeupdate();   }     else if (strbranch.equalsignorecase("tanay")) {        ps_tanay.executeupdate();      ps_aupdate.executeupdate();   }     


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -