⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adapterdao.java

📁 该代码是一个关于医药进销存管理系统的源代码
💻 JAVA
字号:
package com.lzw.dao;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;

import java.util.List;
import org.springframework.orm.hibernate3.SessionFactoryUtils;

import com.lzw.model.*;
import com.lzw.view.JF_view_error;

import javax.swing.JOptionPane;
public class AdapterDao {
    private Resource resource = null;
    private XmlBeanFactory factory = null;

    private static DaoSupport dao = null;

    public AdapterDao(){
       // getdao();
    }
    public boolean getdao(){
        try{
            this.resource = new ClassPathResource("appcontext.xml",getClass());
            this.factory = new XmlBeanFactory(resource);
            this.dao = (DaoSupport) factory.getBean("DAOProxy");
            return true;
        }catch(Exception e){
            e.printStackTrace();
            JF_view_error error = new JF_view_error(e.getMessage());
            error.setTitle("初始化数据连接失败,错误信息如下:");
            return false;
        }
    }
    public static boolean insertmedicine(obj_medicine medicine){
        return dao.InsertMedicine(medicine);
    }
    public static boolean insertclient(Obj_client objclient){
        return dao.InsertClient(objclient);
    }
    public static boolean insertmedicine(Obj_gys objgys){
        return dao.InsertMedicine(objgys);
    }
    public static boolean InsertSellMain(Obj_SellMain obj){
        return dao.InsertSellMain(obj);
    }
    public static boolean InsertSellDetaile(Obj_SellDetaile obj){
        return dao.InsertSellDetaile(obj);
    }
    public static boolean InsertBuyMain(Obj_BuyMain obj){
        return dao.InsertBuyMain(obj);
    }
    public static boolean InsertBuyDetaile(Obj_BuyDetaile obj){
        return dao.InsertBuyDetaile(obj);
    }
    public static boolean InsertStock(Obj_Stock obj){
        return dao.InsertStock(obj);
    }
    public static boolean InsertObj_SellDetaileTh(Obj_SellDetaileTh obj){
        return dao.InsertObj_SellDetaileTh(obj);
    }
    public static boolean InsertObj_UserName(Obj_UserName obj){
        return dao.InsertObj_UserName(obj);
    }

    public static List QueryObject(String str){
        return dao.QueryObject(str);
    }

    public static void DeleteUser(Obj_UserName user){
        dao.DeleteUser(user);
    }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -