日期:2014-05-19  浏览次数:20656 次

如何从Spring 获取 Connection?
如何从Spring中获取Connection,来实现多表的管理更新

------解决方案--------------------
Java code

Connection conn = sessionFactory.getCurrentSession().connection();

------解决方案--------------------
Java code

DataSource ds = ApplicationContextHolder.getBean("myDataSource");
Connection conn = ds.getConnection();