Re: Copying from Result Set to Array List

2009-07-16 Thread Sean
In all places you reference your callback, including the Async Interface, make it's AsyncCallbackArrayListString callback and NOT: AsyncCallbackString callback On Jul 15, 6:52 pm, Chad chad...@gmail.com wrote: Well, just that. The code you originally posted showed you trying to

Re: Copying from Result Set to Array List

2009-07-16 Thread Rahul
Hi, Thanks for the reply. I have changed the following things you asked me to do. This is the code of my onSuceess Method public void onSuccess(ArrayListString result) { // TODO Auto-generated method stub

Re: Copying from Result Set to Array List

2009-07-16 Thread Sean
You can simplify that a lot by just doing: String firstResult = result.get(0); You have a lot of conversions that are uncessceary. But judging by the error you're str has no elements in it. What you want to check is result.size() 0 On Jul 16, 10:05 am, Rahul coolrahul18...@gmail.com wrote:

Re: Copying from Result Set to Array List

2009-07-16 Thread Rahul
hi thanks a lot you guys its started working :) On Jul 16, 10:42 am, Sean slough...@gmail.com wrote: You can simplify that a lot by just doing: String firstResult = result.get(0); You have a lot of conversions that are uncessceary. But judging by the error you're str has no elements in it.

Copying from Result Set to Array List

2009-07-15 Thread Rahul
Hi, I apologize because this topic is again n again asked on the forum, but after reading the topics I was not able to get an answer to my problem. I am connecting to a server and trying to display an sql query on the browser. Here is my server side code: public class GreetingServiceImpl

Re: Copying from Result Set to Array List

2009-07-15 Thread Chad
Rahul, Based on your query (select SourceTableName from SourceTables), I would guess that your result set would contain a single column with string data (char or varchar in SQL). If that's correct, then your loop should look more like this: while (rs.next()) { rowArray.add(rs.getString(1)); }

Re: Copying from Result Set to Array List

2009-07-15 Thread Sean
while(rs.next()) is fine and pretty standard way to go through. I'm confused by how you are adding the data to the ArrayList though. You get your resultSet which judging by your query should be TableNames, which I assume are Strings?. But you're getting it out as an INT then converting to a

Re: Copying from Result Set to Array List

2009-07-15 Thread Rahul
Hi, Thanks for replying I am getting the following error [ERROR] Uncaught exception escaped java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.String at com.example.test7.client.Test7$1MyHandler$1.onSuccess(Test7.java: 1) at

Re: Copying from Result Set to Array List

2009-07-15 Thread Rahul
Hi Sean, Thanks for replying. I understood what you are trying to say. @Chad can you elborate on Your code would only work if the SourceTableName column in the SourceTables table is of an integer type. My column name is presently an varchar type On Jul 15, 11:49 am, Rahul

Re: Copying from Result Set to Array List

2009-07-15 Thread Chad
Well, just that. The code you originally posted showed you trying to retrieve integer data from your result set, but your table contains string type data so your code wouldn't have worked. Now, the error you posted looks like you are trying to cast your result to a String in your onSuccess