Java GoogleWebToolkit(GWT)创建读取更新和删除(CRUD)应用程序的示例
你好Java GoogleWebToolkit(GWT)创建读取更新和删除(CRUD)应用程序的示例,java,gwt,crud,Java,Gwt,Crud,你好 有人知道基于Google Web Take(GWT)的创建、读取、更新和删除应用程序的任何示例吗。 也就是说,使用GWT操作和显示数据库内容的应用程序 谢谢,GWT是一种客户端技术,因此基本上只提供UI。任何CRUD进程都会发生在服务器端,可以是任何J2EE代码 无论如何,您可以看看,它为您的问题提供了一个很好的解决方法(您需要实现服务器端存储) 还要看一下文档 它对您有帮助吗?这是一个框架CRUD应用程序,我认为这对寻找相同问题答案的人很有帮助 网上没有太多这样的例子。 但我通常是这样做
有人知道基于Google Web Take(GWT)的创建、读取、更新和删除应用程序的任何示例吗。
也就是说,使用GWT操作和显示数据库内容的应用程序
谢谢,GWT是一种客户端技术,因此基本上只提供UI。任何CRUD进程都会发生在服务器端,可以是任何J2EE代码 无论如何,您可以看看,它为您的问题提供了一个很好的解决方法(您需要实现服务器端存储) 还要看一下文档
它对您有帮助吗?这是一个框架CRUD应用程序,我认为这对寻找相同问题答案的人很有帮助
网上没有太多这样的例子。 但我通常是这样做的: 假设您希望从数据库中获取某个表的所有内容:
public class GreentingServiceIMPL extends RemoteSericeServlet implments GreentingService
{
public ArrayList<String> getEverything()
{
String query="Select * from....";
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection conn=DriverManager.getConnection(url,user,password);
Statement stmt = conn.createStatement();
//get stuff out of daatabase here and retun as an arraylist
}
}
公共接口GreentingServiceExtendedRemoteService
{
ArrayList getEverything();
} public class GreentingServiceIMPL extends RemoteSericeServlet implments GreentingService
{
public ArrayList<String> getEverything()
{
String query="Select * from....";
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection conn=DriverManager.getConnection(url,user,password);
Statement stmt = conn.createStatement();
//get stuff out of daatabase here and retun as an arraylist
}
}
公共接口服务
{
void getEverything(异步回调);
} public class GreentingServiceIMPL extends RemoteSericeServlet implments GreentingService
{
public ArrayList<String> getEverything()
{
String query="Select * from....";
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection conn=DriverManager.getConnection(url,user,password);
Statement stmt = conn.createStatement();
//get stuff out of daatabase here and retun as an arraylist
}
}
公共类GreentingServiceIMPL扩展了RemoteSericeServlet Implets GreentingService
{
公共阵列列表getEverything()
{
String query=“选择*来自…”;
Class.forName(“com.mysql.jdbc.Driver”).newInstance();
Connection conn=DriverManager.getConnection(url、用户、密码);
语句stmt=conn.createStatement();
//从这里的数据库中获取内容,并作为arraylist重新运行
}
}
@覆盖
失败时的公共无效(可丢弃){
//无所事事
}
@凌驾
成功时公共无效(ArrayList结果){
对于(int i=0;i
。。。。。。。。。。。。。。。
}//无模负载
}//阶级这是一个基于web的CRUD应用程序,我在过去几年中为我的雇主编写了该应用程序,现在获得了开源许可: 它使用GWT作为前端,使用Hibernate将数据持久化到后端。数据结构只需要在一个中心位置(DomainObject类)定义,因为GUI和后端都是以不依赖于数据结构的通用方式编写的 如果有人有时间看一看的话,我很乐意听到评论或回答问题