Java学习从这里JavaVideo开始

JavaVideo java学习从这里开始

当前位置: 主页 > 热门框架 > Spring >

MyBatis+Spring基于接口编程的原理分析

时间:2011-06-07 00:11来源: 作者:admin 点击:
整合Spring3及MyBatis3   对于整合Spring及Mybatis不作详细介绍,可以参考: MyBatis 3 User Guide Simplified Chinese.pdf,贴出我的主

猎头职位:

相关文章:

  • MyBatis3新手上路
  • 整合Mybatis与Spring3
  • 推荐群组: Drools 更多相关推荐

    整合Spring3及MyBatis3
      对于整合Spring及Mybatis不作详细介绍,可以参考: MyBatis 3 User Guide Simplified Chinese.pdf,贴出我的主要代码如下:
    UserMapper Interface:
    package org.denger.mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import org.denger.po.User; public interface UserMapper { @Select("select * from tab_uc_account where id=#{userId}") User getUser(@Param("userId") Long userId); }

    application-context.xml:
    <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/context http://www.springframework.org/schema/aop http://www.springframework.org/schema/tx "> <!-- Provided by annotation-based configuration --> <context:annotation-config/> <!--JDBC Transaction Manage --> <bean> <constructor-arg> <ref bean="dataSource" /> </constructor-arg> </bean> <!-- The JDBC c3p0 dataSource bean--> <bean destroy-method="close"> <property value="com.mysql.jdbc.Driver" /> <property value="jdbc (责任编辑:JavaVideo)
    顶一下
    (0)
    0%
    踩一下
    (0)
    0%
    ------分隔线----------------------------
    发表评论
    请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
    评价:
    表情:
    用户名: 验证码:点击我更换图片
    栏目列表
    推荐内容