The best way, IMO, is to not use GWT-RPC, but rather implement an
HttpServlet, that retrieves the data from the database and returns it with
the appropriate Content-Type in response to a GET http request. Then, you
simply place an image in your GWT code, with its source being the path to
the servlet (defined in your web.xml), passing along any parameters required
- such as the ID of the image in the database.

On Thu, Mar 12, 2009 at 12:59 PM, fatjack1...@googlemail.com <
fatjack1...@googlemail.com> wrote:

>
> Hi,
>
> I am new to loading images into GWT from MySQL and am abit lost on the
> best way to do it.
>
> I already have my image in the database. How do I retrieve it? I read
> somewhere that it can just be stored as a String. Is this correct? So
> my code on the server side would look like:
>
> //Open database connection
> dc.openConnection();
> resultSet = dc.statement.executeQuery(SELECT CategoryImage FROM
> itemcategory_table WHERE ItemType = 'Test');
>
>   while(resultSet.next()) {
>        String test = resultSet.getString(1);
> }
>
> dc.closeConnection();
>
> Or have I got this completely wrong?
>
> Next, I need to send this over to the client. What is the best way to
> send an image over from the server to the client and how should it be
> stored?
>
> Any help on how to use images would be much appreciated!
>
> Regards,
> Jack
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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