csdn下载里搜索一下ibatis就可以了,一堆的项目

解决方案 »

  1.   

    我想要具体的代码,项目是照着  jpetstore 写的!
      

  2.   

    web开发就是实现优先,数据量大速度很慢时,才考虑算法改进通常“其他的方法”指的是不同框架下的不同标签代码
      

  3.   

    各位新年快乐ibatis:
    <sqlMap namespace="User">
        <select id="checkExistByEmail" resultClass="Integer" parameterMap="HashMap">
            select count(user)
            from <include refid="user_table"/>
            where email = #value# and password =#password#
        </select>
    </sqlMap>config:
    <!--  START iBATIS config -->
        <bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
             <property name="dataSource" ref="dataSource" />
             <!--  this needs to point to where the sql-map-config.xml file is -->
             <property name="configLocation" value="classpath:sql-map-config.xml" />
        </bean>
        
        <bean id="sqlMapClientTemplate" class="org.springframework.orm.ibatis.SqlMapClientTemplate">
       <property name="sqlMapClient" ref="sqlMapClient" />
    </bean>
    <!--  END iBATIS config -->userDaoImpl:
    public Integer checkExistByEmail(String email, String password) throws DataAccessException {
                 Map<String,Object> cond = new HashMap<String,Object>();
                 cond.put("email", email);
                 cond.put("password", password);
    return (Integer) sqlMapClientTemplate.queryForObject("checkExistByEmail", cond );
    }userServiceImpl:
           if(userDao.checkExistByEmail(email, password)==1){
             //如果用户存在则……
           }else{
            //不存在……
           }