• 大小: 13.84MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-07-31
  • 语言: 数据库
  • 标签: ssh2  sqlserver  

资源简介

ssh2+sqlserver数据库整合测试成功版

资源截图

代码片段和文件信息

package com.eshop.action.admin;

import java.util.List;

import com.eshop.Idao.admin.IAdminDAO;
import com.eshop.pojo.admin.Admin;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class AdminAction extends ActionSupport{
/**
 * 
 */
private static final long serialVersionUID = 1L;
private Admin admin;
private IAdminDAO ia;
private List admins;
public IAdminDAO getIa() {
return ia;
}
public void setIa(IAdminDAO ia) {
this.ia = ia;
}

public List getAdmins() {
return admins;
}
public void setAdmins(List admins) {
this.admins = admins;
}   

public Admin getAdmin() {
return admin;
}
public void setAdmin(Admin admin) {
this.admin = admin;
}
public String findOneAdmin(){

try{
admin = ia.findById(admin.getId());
System.out.println(admin.getPwd());
ActionContext.getContext().put(“name“admin.getName());
return this.SUCCESS;
}catch(Exception ss){
return this.ERROR;
}

}
public String findAllAdmin(){

try{
admins=ia.findAll();
//ActionContext.getContext().put(“admins“admins);
return this.SUCCESS;
}catch(Exception de){
return this.ERROR;
}

}
public String save(){
try{
ia.save(admin);
ActionContext.getContext().put(“name“admin.getName());
return this.SUCCESS;
}catch(Exception ss){
return this.ERROR;
}

}
public String delete(){
try{
ia.delete(admin);
return this.SUCCESS;
}catch(Exception de){
return this.ERROR;
}
}
public String merge(){
try{
//数据更新时,不能将内存中的数据及时更新到数据库,此处应如何做attachDirty
System.out.println(admin.getName());
ia.attachDirty(admin);
System.out.println(admin.getName()+“*“);
ActionContext.getContext().put(“name“admin.getName());
return this.SUCCESS;
}catch(Exception de){
return this.ERROR;
}
}

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2011-06-24 21:34  EShop1\
     文件        3543  2011-05-29 19:10  EShop1\.classpath
     目录           0  2011-06-24 21:34  EShop1\.myeclipse\
     文件         291  2011-06-01 22:21  EShop1\.mymetadata
     文件        1412  2011-05-29 19:10  EShop1\.project
     目录           0  2011-06-24 21:34  EShop1\.settings\
     文件         500  2011-05-29 19:11  EShop1\.settings\.jsdtscope
     文件          49  2011-05-29 19:11  EShop1\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2011-05-29 19:11  EShop1\.settings\org.eclipse.wst.jsdt.ui.superType.name
     文件           8  2011-06-08 10:23  EShop1\Desktop__.ini
     目录           0  2011-06-24 21:34  EShop1\src\
     文件         913  2011-05-29 20:35  EShop1\src\application-beans.xml
     文件        2048  2011-05-29 19:11  EShop1\src\application-transaction.xml
     目录           0  2011-06-24 21:34  EShop1\src\com\
     文件           8  2011-06-08 10:23  EShop1\src\com\Desktop__.ini
     目录           0  2011-06-24 21:34  EShop1\src\com\eshop\
     目录           0  2011-06-24 21:34  EShop1\src\com\eshop\action\
     目录           0  2011-06-24 21:34  EShop1\src\com\eshop\action\admin\
     文件        2011  2011-05-29 23:19  EShop1\src\com\eshop\action\admin\AdminAction.java
     文件           8  2011-06-08 10:23  EShop1\src\com\eshop\action\admin\Desktop__.ini
     文件           8  2011-06-08 10:23  EShop1\src\com\eshop\action\Desktop__.ini
     目录           0  2011-06-24 21:34  EShop1\src\com\eshop\dao\
     目录           0  2011-06-24 21:34  EShop1\src\com\eshop\dao\admin\
     文件        4533  2011-05-29 22:28  EShop1\src\com\eshop\dao\admin\AdminDAO.java
     文件           8  2011-06-08 10:23  EShop1\src\com\eshop\dao\admin\Desktop__.ini
     文件           8  2011-06-08 10:23  EShop1\src\com\eshop\dao\Desktop__.ini
     文件           8  2011-06-08 10:23  EShop1\src\com\eshop\Desktop__.ini
     目录           0  2011-06-24 21:34  EShop1\src\com\eshop\Idao\
     目录           0  2011-06-24 21:34  EShop1\src\com\eshop\Idao\admin\
     文件           8  2011-06-08 10:23  EShop1\src\com\eshop\Idao\admin\Desktop__.ini
     文件         739  2011-05-29 20:39  EShop1\src\com\eshop\Idao\admin\IAdminDAO.java
............此处省略108个文件信息

评论

共有 条评论