This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
This is servlet by which i am inserting values in the database but if i dont enter any value of i2,q2,c2,i3,q3 and c3 then according to my servlet it should not insert any values to database but it is not doing so..if condition is not working......
Rakhi, there is no way an if condition would "not be working". If the i1 is not null, the body of the if statement is executed, if it is null, it isn't executed. There is no third possibility out there.
I'd strongly suggest to activate logging in your application (if you do not know why, try to search out or maybe ask in some relevant forum here) and print all the variables in your code to a log to see what you're getting in. Another option would be to debug your application using a debugger, if that is feasible for your architecture. You need to learn at least one of these two approaches, if you want to be able to do a career in programming.
rakhi sinha
Ranch Hand
Joined: Mar 26, 2012
Posts: 147
posted
0
Martin Vajsar wrote:Rakhi, there is no way an if condition would "not be working". If the i1 is not null, the body of the if statement is executed, if it is null, it isn't executed. There is no third possibility out there.
I'd strongly suggest to activate logging in your application (if you do not know why, try to search out or maybe ask in some relevant forum here) and print all the variables in your code to a log to see what you're getting in. Another option would be to debug your application using a debugger, if that is feasible for your architecture. You need to learn at least one of these two approaches, if you want to be able to do a career in programming.
i dont understand why my code is not running ......how to activate logging in my application.