GWT Web应用程序项目,与Hibernate? [英] GWT Web Application project, with Hibernate?

查看:120
本文介绍了GWT Web应用程序项目,与Hibernate?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Eclipse中创建了一个Google Web应用程序项目,并且现在遇到了问题,因为我需要从服务器端的角度来考虑使用Hibernate和MySQL。我刚才被告知Google Web Application项目无法在部署项目时运行与MySQL的Hibernate连接。



我迁移这个项目的最佳方式是什么项目以某种方式运行,所以它运行在Glassfish上,并且仅仅使用GWT作为客户端技术,然后可以使用Hibernate和MySQL,而不是实际部署?



谢谢, 直接从客户端。



GWT将您的客户端Java代码翻译成运行在浏览器中的Javascript;没有办法直接访问JDBC。



您将不得不采用服务器端来处理您的数据库持久性。您的客户可以通过 GWT-RPC 进行通信, JSON XML 或任何其他协议 - 但数据库连接部分将始终驻留在服务器上。



请注意,服务器部分不需要使用Java - 它可以使用PHP 或任何其他技术,只要它了解从您的应用程序生成的JavaScript即可。


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

解决方案

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.

这篇关于GWT Web应用程序项目,与Hibernate?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆