GWT Web Application project, with Hibernate?

徘徊边缘 提交于 2020-01-06 15:18:07

问题


I've made a Google Web Application Project in Eclipse and am now running into problems as I need to use from a server side point of view, with Hibernate with MySQL. I've just been told that Google Web Application projects can't run Hibernate connections to MySQL as they're deployed projects.

What's the best way for me to migrate this project somehow so it runs on say Glassfish and just uses GWT for the client side technologies that can then use Hibernate and MySQL, rather than actually being deployed?

Thanks,

David


回答1:


You cannot access database from client-side directly.

GWT translates your client-side java code into Javascript which runs in browser; there is no way to directly access JDBC.

You will have to employ server-side which will handle your DB persistence. Your client can communicate via GWT-RPC, JSON, XML, or any other protocol - but the database connection part will always reside on server.

Note that the server part does not need to be in Java - it can use PHP or any other technology, as long as it understands the javascript generated out of your app.



来源:https://stackoverflow.com/questions/7148152/gwt-web-application-project-with-hibernate

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!