Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
AdapterDao.java
Package: Appjxc.rar [view]
Upload User: whbcdz
Upload Date: 2008-08-04
Package Size: 7683k
Code Size: 3k
Category:
JavaScript
Development Platform:
Java
- package appjxc.dao;
- import org.springframework.beans.factory.xml.XmlBeanFactory;
- import org.springframework.core.io.ClassPathResource;
- import org.springframework.core.io.Resource;
- import appjxc.model.*;
- import java.util.List;
- import org.springframework.orm.hibernate3.SessionFactoryUtils;
- import javax.swing.JOptionPane;
- import appjxc.view.JF_view_error;
- 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");
- System.out.println("resourc = " + resource);
- this.factory = new XmlBeanFactory(resource);
- System.out.println("factory = " + factory);
- this.dao = (DaoSupport) factory.getBean("DAOProxy");
- System.out.println("dao = " + dao);
- //JOptionPane.showMessageDialog(null,"初始化数据成功!!!","系统提示",JOptionPane.INFORMATION_MESSAGE);
- return true;
- }catch(Exception e){
- e.printStackTrace();
- System.out.println("Erro; = " + e.getMessage());
- JF_view_error error = new JF_view_error(e.getMessage());
- error.setTitle("初始化数据连接失败,错误信息如下:");
- return false;
- //JOptionPane.showMessageDialog(null,"初始化数据失败,错误信息如下:n" + e.getMessage(),"系统提示",JOptionPane.INFORMATION_MESSAGE);
- }
- }
- 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);
- }
- }