设为首页 加入收藏

TOP

spring之jdbcTemplate实例(三)
2015-07-20 17:19:10 来源: 作者: 【 】 浏览:11
Tags:spring jdbcTemplate 实例
rson getDeletePerson() {
return deletePerson;
}

public void setDeletePerson(DeletePerson deletePerson) {
this.deletePerson = deletePerson;
}
public int delete (Person person){
System.out.println("执行persondelete");
return deletePerson.delete(person);

}
}

?

6、配置文件





com.mysql.jdbc.Driver





root



admin



















?







?

7、测试类

/**
*
*/
package com.test;

import java.util.List;
import java.util.Map;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.inspur.jdbcMapper.MyDelete;
import com.inspur.jdbcMapper.MyInsert;
import com.inspur.jdbcMapper.MySelect;
import com.inspur.jdbcMapper.Person;

import junit.framework.TestCase;
/**
*@author WHD
*2014-10-4
*/
public class TestDisk extends TestCase{

public void testSpring(){
ApplicationContext act = new ClassPathXmlApplicationContext("appMapper.xml");
MyInsert myinsert= (MyInsert)act.getBean("myInsert");
MyDelete myDelete=(MyDelete)act.getBean("myDelete");
Person p= new Person();
p.setAge(8);
p.setName("name8");
myinsert.tell();
myinsert.insert(p);
myDelete.delete(p);
System.out.println("结束");
}

}

?

?

首页 上一页 1 2 3 下一页 尾页 3/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇poj 3630 Phone List trie 下一篇hdu 5172 RMQ

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·怎样用 Python 写一 (2025-12-27 02:49:19)
·如何学习python数据 (2025-12-27 02:49:16)
·想要自学数据分析, (2025-12-27 02:49:14)
·Java 集合框架 - 菜 (2025-12-27 02:19:36)
·Java集合框架最全详 (2025-12-27 02:19:33)