Hi ,

I have a GWT Client , which is calling JDBC Code on server .
The problem is that the after executing the method , AsyncCallback's
success nor the failure is not being getting called , please help

This is my EntryPoint class :

Panel panel = RootPanel.get();
final ListBox lb = new ListBox();
lb.addItem("One");
panel.add(lb);

lb.addClickHandler(new ClickHandler() {
                public void onClick(ClickEvent event) {
                loadCampaignList();
                }


        public void loadCampaignList() {
                                        inter.getInfo1(new 
AsyncCallback<ArrayList<MyBean>>() {
                                                public void 
onSuccess(ArrayList<MyBean> result)
{
System.out.println("Into success")
                                                        }

                                                        public void 
onFailure(Throwable caught) {
 
System.out.println(caught.getMessage());

                                                        }
                                                });


This is my Server side implementation code , which is working fine

public class CInterfaceImpl extends RemoteServiceServlet implements
CInterface {

        public static ArrayList<MyBean> list1Elem;

        public ArrayList<MyBean> getInfo1() {
                list1Elem = new ArrayList<MyBean>();
                System.out.println("Sai Naaaatha");
                Connection con = null;
                String url = "jdbc:mysql://localhost:3306/";
                String db = "test";
                String driver = "com.mysql.jdbc.Driver";
                String user = "root";
                String pass = "root";

                try {
                        Class.forName(driver);

                        con = DriverManager.getConnection(url + db, user, pass);
                        Statement st = con.createStatement();
                        ResultSet rs = st.executeQuery("select First , Second 
from POC");
                        while (rs.next()) {
                                System.out.println("Into the rs.next 
conditin33");
                                MyBean bean = new MyBean();
                                bean.setFirst(rs.getInt(1));
                                bean.setFirst(rs.getInt(2));
                                list1Elem.add(bean);

                        }

                        Iterator itr4 = list1Elem.iterator();
                        while (itr4.hasNext()) {

                                MyBean ban = (MyBean) itr4.next();
                                System.out.println(ban.getFirst());
                                System.out.println(ban.getSecond());

                        }

                        con.close();

                } catch (Exception ex) {
                        System.out.print(ex.getMessage());
                }
                return list1Elem;
        }

}

This is my DTO

package com.server;

import java.io.Serializable;

import com.google.gwt.user.client.rpc.IsSerializable;

public class MyBean  implements IsSerializable{

        public MyBean()
        {

        }

        private int First ;
        public int getFirst() {
                return First;
        }
        public void setFirst(int first) {
                First = first;
        }
        public int getSecond() {
                return Second;
        }
        public void setSecond(int second) {
                Second = second;
        }
        private int Second ;



}


Please help . Thanks .

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to