Hauke Ingmar Schmidt wrote:Welcome!
GWT Java code is compiled to JavaScript. The result runs in the client's browser. It can't create an SQL connection.
You need some server-side component that does this and some means of communication between the two. The server-side component can be anything, like a PHP application, a Ruby on Rails application or some Java application. The communication between client and server can be easy when you use Java; GWT comes with a custom RPC servlet that lets you send Java objects back and forth between client and server. If your server faciliates some other language/basis, a good way to choose would be REST with XML or JSon. (In fact it may even be a good idea when your server is Java based.)
On the server side you use the framework's or language's capabilities for SQL databse access as usual.
Valex Id wrote:
Thanks for you reply !!!
I know that , i read about this ... but you can give me an little exemple with Rpc way ? if you can to create a project where you make this connect ... i lose 5 days ... and i don't solve my problem ... can you help ?
Hauke Ingmar Schmidt wrote:
Valex Id wrote:
Thanks for you reply !!!
I know that , i read about this ... but you can give me an little exemple with Rpc way ? if you can to create a project where you make this connect ... i lose 5 days ... and i don't solve my problem ... can you help ?
I can try to help.
But I don't even know your prerequisites. How does your server side look like?
For an introduction into GWT-RPC take a look here.
Valex Id wrote:
I have local MySql server, I'm using Netbeans(with Tomcat ) and Eclipse ( in Eclipse i'm using appengine web server, I dont know how to set Tomcat for GWT applications... ) . If you can show me an example where you connect to the Mysql server with RPC, then I will set my sql parametres and try to connect to my server ....
Thanks ... !
Maneesh Godbole wrote:In your original post you mentioned GAE.
It is true, if you host your application to the gae jpa. However, you can always host your GWT app on tomcat and connect to the DB of your choice
Hauke Ingmar Schmidt wrote:
.... You can't use every feature of every persistence framework when sending objects to the GWT client, e.g. lazy loading will break. So you need to take care of what you send.
Maneesh Godbole wrote:
Hauke Ingmar Schmidt wrote:
.... You can't use every feature of every persistence framework when sending objects to the GWT client, e.g. lazy loading will break. So you need to take care of what you send.
I am not sure I understand you clearly here.
Ideally the persistence mechanism should be transparent to the client. As long as the client performs its data communication with the server, using serialized POJOs which can be translated to JS, all should be smooth sailing.
Forget Steve. Look at this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|