摘要: http://static.springsource.org/spring/docs/current/spring-framework-reference/html/jdbc.html以上是官方教程,讲得非常详细,两种方法。但是,有一点没讲,使用这种办法,必须要保证这个类在 bean的管理之下,就是说,写在controller里面,然后实例也标记autowired。你自己定义实例是没用的,不属于bean管理的范畴,所以autowired 的setDataSource方法不会被调用!最后,我的办法是,获得dataSourceApplicationContext ac = WebApplicati 阅读全文
posted @ 2013-04-16 00:46 Reddington 阅读(317) 评论(0) 推荐(0) 编辑