public class Userdao extends Hibernatedaosupport implements iuserdao{//public List name=null; List List=null; public void Insertuser (UserInfo user) {gethibernatetemplate (). saveorupdate (user);} public List Finduser (String sql) { Return Gethibernatetemplate (). find (SQL); }}
public class login{Private List list=null, private String sql= "from UserInfo"; Public List getallmessagelist () {try{InputStream is = new FileInputStream ("Bean.xml"); Xmlbeanfactory factory = new Xmlbeanfactory (IS); Iuserdao user = (Iuserdao) factory.getbean ("Daoproxy"); List = User.finduser (SQL); }catch (IOException IoE) {System.out.println ("Getallmessagelist Ocurr error!! Message: "+ioe.getmessage ()); } return list; }}
Hibernate is an advanced OR mapping tool, and Spring is an AOP framework and an IOC container. The combination of these two technologies allows developers to write code comparable to database vendors, which can be run in the Java EE container or run separately.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.