I am using jdbc connectivity with java....i want to retrieve values of resultset so that i can use these values outside the loop .....please help me...
By using following statement more than one rows are retrieved .....
I want to display different values of a,b,c and d in table in pdf .how can we do this......
Ulf Dittmer wrote:If you want to print incremental numbers then don't reset i to 1 in each iteration.
but int i is giving error because The method addCell(PdfPCell) in the type PdfPTable is not applicable for the arguments (int).so what should i use?
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35223
7
posted
0
The first thing to do is to move the "int i=1" outside of the loop.
archana tiwari
Ranch Hand
Joined: Mar 15, 2012
Posts: 44
posted
0
Ulf Dittmer wrote:The first thing to do is to move the "int i=1" outside of the loop.
I have checked it also .. i have put int i=1 outside the loop
but table.addCell(i); is giving error.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35223
7
posted
0
There is no method PdfPTable.addCell(int) - what made you think there is? If you want to add the value of i as a string then the easiest way is to construct a String from i and call PdfPTable.addCell(String).
archana tiwari
Ranch Hand
Joined: Mar 15, 2012
Posts: 44
posted
0
Ulf Dittmer wrote:There is no method PdfPTable.addCell(int) - what made you think there is? If you want to add the value of i as a string then the easiest way is to construct a String from i and call PdfPTable.addCell(String).
but using string we can not increment it to 1 then 2 then 3 we get 1 then 11 then 111 by concatenating the string.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35223
7
posted
0
I didn't say you should increment a string, I said you should convert the int to a string when calling the PdfPTable.addCell method.
archana tiwari
Ranch Hand
Joined: Mar 15, 2012
Posts: 44
posted
0
Ulf Dittmer wrote:I didn't say you should increment a string, I said you should convert the int to a string when calling the PdfPTable.addCell method.
thanks ...problem is solved....
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.