<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    沉睡森林@漂在北京

    本處文章除注明“轉載”外均為原創,轉載請注明出處。

      BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
      152 隨筆 :: 4 文章 :: 114 評論 :: 0 Trackbacks

           /**

            * @param args

            */

           public static void main(String[] args) {

                  // TODO Auto-generated method stub

                  String [] conf = new String[2];

            conf[0]="applicationContext.xml";

            conf[1]="dataAccessContext-jdbc.xml";

            ApplicationContext appContext = new ClassPathXmlApplicationContext(conf);

    //        UserService us = (UserService) appContext.getBean("userService");

            Customer cu = new Customer();

            cu.setName("11");

            cu.setAddress("aa");

            cu.setEmail("ss");

            cu.setPhone("ssss");

            ICustomerService cs = (ICustomerService) appContext.getBean("customerService");

           

            cs.insert(cu);

           

            System.out.println("hello world!");

           }

     

     

     

     

     

    package com.example.test;

     

    import org.junit.Test;

    import org.springframework.beans.factory.annotation.Autowired;

    import org.springframework.test.context.ContextConfiguration;

    import org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests;

     

    import com.example.domain.Customer;

    import com.example.service.ICustomerService;

     

    @ContextConfiguration(locations={"test-customerService.xml"})

    public class TestCustomerService extends

           AbstractTransactionalJUnit4SpringContextTests {

        @Autowired

        private ICustomerService cs;

     

        @Test

        public void handleUserLogin() {

           // User user = new User();

           // user.setUserId(1);

           // user.setLastIp("127.0.0.1");

           // Date now = new Date();

           // user.setLastVisit(now.getTime());

           // userService.handleUserLogin(user);

     

           Customer cu = new Customer();

           cu.setName("11");

           cu.setAddress("aa");

           cu.setEmail("ss");

           cu.setPhone("ssss");

     

           cs.insert(cu);

     

           System.out.println("hello world!");

        }

    }

    在同一目錄下放入文件:

    <?xml version="1.0" encoding="UTF-8"?>

    <beans xmlns="http://www.springframework.org/schema/beans"

        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

        xsi:schemaLocation="http://www.springframework.org/schema/beans

    http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">

     

    <!--  引入清單1定義的Spring配置文件 -->

        <import resource="classpath:/applicationContext.xml" />

        <import resource="classpath:/dataAccessContext-jdbc.xml" />

    </beans>

    posted on 2009-02-14 21:56 王總兵 閱讀(173) 評論(0)  編輯  收藏

    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    主站蜘蛛池模板: 1区2区3区产品乱码免费| 欧洲乱码伦视频免费国产| 毛片免费在线观看| 亚洲精品无码mv在线观看网站 | 国产午夜亚洲精品| 97在线线免费观看视频在线观看| 亚洲成人在线免费观看| 在线视频精品免费| 最新亚洲春色Av无码专区| 好吊妞在线成人免费| 亚洲欧洲国产综合AV无码久久| 免费网站看v片在线香蕉| 在线播放亚洲精品| 国产亚洲情侣一区二区无码AV| 抽搐一进一出gif免费视频| 日本亚洲成高清一区二区三区| 久久ww精品w免费人成| 亚洲一区免费视频| 四虎影视永久免费观看| a毛片成人免费全部播放| 欧洲亚洲国产清在高| 亚洲一区二区三区免费视频| 亚洲爆乳AAA无码专区| 久久影视综合亚洲| 999久久久免费精品播放| 亚洲乱码无人区卡1卡2卡3| 亚洲精品视频在线看| 未满十八18禁止免费无码网站 | 日韩亚洲AV无码一区二区不卡| 妻子5免费完整高清电视| 久久精品国产亚洲AV电影网| 久久影视国产亚洲| 久久国内免费视频| 一级做a爰片性色毛片免费网站 | 久久亚洲AV午夜福利精品一区| 无人在线观看完整免费版视频| 全部在线播放免费毛片| 亚洲性无码av在线| 精品国产香蕉伊思人在线在线亚洲一区二区| 99精品视频在线观看免费专区| 成人精品国产亚洲欧洲|