First, you need data transfer objects (DTOs). For each table in your
DB you write a simple class that holds the data of a single row.

MySQL:
TABLE account:
  user_id INTEGER
  user_name VARCHAR

Java:
public class Account implements Serializable {
  public int user_id;
  public String user_name;
}

This is the simplest form. Normally, you don't want to make your
fields "public" and use getters and setters instead:
getUserId(), getUserName(), setUserId(int userId), setUserName(String
userName).

Now you need some server-side CRUD code to copy data between ResultSet
and Account, and between Account and PreparedStatement.
Write unit tests!

As soon as this works you define a service interface and an async
service interface:

public interface AccountService extends RemoteServer {
  Account find(int userId);
  void save(Account account);
  void delete(int userId);
}
public interface AccountServiceAsync {
  void find(int userId, AsyncCallback<Account> callback);
  void save(Account account, AsyncCallback<Void> callback);
  void delete(int userId, AsyncCallback<Void> callback);
}

On the server-side you extend RemoteServiceServlet and let the
subclass implement AccountService.
On the client-side you use GWT.create(AccountService.class) to get an
implementation of AccountServiceAsync.
:
http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5&s=google-web-toolkit-doc-1-5&t=DevGuideRemoteProcedureCalls


On Aug 31, 10:43 am, Abel B <[EMAIL PROTECTED]> wrote:
> Hi, I am new to both the java language and gwt. I have been reading on
> the language for a few months and I have a grasp on some of the most
> important concepts.
>
> I have been having a hard time rendering data on a browser aftre
> making server side calls to a mysql db. I have read about using remote
> procedure calls on the server side and then using the entry point
> class to render the info retrieved from the application service.
>
> Is there anyone who knows where I can get a step by step guide on
> working with CRUD functions and rendering them on the browser using
> gwt. I'm at a loss on what im doing wrong.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to