首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

SSH2 SQL 跟 HQL 查询方式

2012-09-22 
SSH2 SQL 和 HQL 查询方式Sql:String sql from luser where username + username + and password

SSH2 SQL 和 HQL 查询方式
Sql:

        String sql = "from luser where username='" + username + "' and password='" + password + "'";
        List ul = getHibernateTemplate().find(sql);
      
Hql:

      String hql ="from luser where username=? and password=?" ;
      Object pra[]=  {username,password};
      List ul = getHibernateTemplate().find(hql, pra);

热点排行