Here,In the while loop,if the variable extnum contains 2 variables from the database,when i print the extnum in the onManagerEvent,it just prints the last variable of the two variables instead of printing 2 variables.How should i solve this problem.Please assist me to do this.
Your code is messy. As David said, split your code a bit. Then you should(and we will ) be able to read and understand your code properly. About your question of only one value getting printed, i believe that you mean to ask that you get 2 records, but only one is printed, if this is your question, then check how you are assigning the value from result set, that should lead you to the answer.
Hope it helps
If I become filthy rich, I'll sponsor research for painless dental treatment at Harvard Medical School. Thats why,I'm learning Java.I have 32 teeth, 22 are man made.
Joined: Oct 04, 2007
Thankyou for your replies.
i believe that you mean to ask that you get 2 records, but only one is printed, if this is your question
yes.This is my question.
check how you are assigning the value from result set
I dont get you.I am assigning the records from the resultset to a string variable extnum.
I have splitted my codes into two classes like :
The above code is to dial the particular numbers whose flag are 0 from the database .
In the following code , I am just getting the extnum and trying to print.But null is printed.
Please locate me where am i wrong?
Joined: Feb 26, 2008
I think you are not exactly getting the purpose of a Servlet.
In you onManager method, you are just instantiating the Servlet, you don't instantiate a servlet yourself, the container does it.
Now, the question, do you need a servlet or just a POJO?
Please revert with what you exaclty need to do. That way people on the forum will be able to help you better.
In your old code, you were assigning the value to the same string object 2 times, that why only the last value was getting printed. Now you are just instantiating the servlet, so the value is bound to be null