配置数据源

 今天在搭框架的时候莫名遇到了 如下问题:

 

原因是 Driver 后多了个空格...

 

单元测试代码:

public class SpringDataTest {

	private ApplicationContext ctx = null;

	{
		ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
	}

	@Test
	public void testDataSource() throws SQLException{

		DataSource dataSource = ctx.getBean(DataSource.class);
		System.out.println(dataSource.getConnection());
	}

}

 

 

无论如何,心平气和。  

posted @ 2017-07-25 10:14  江湖一笑  阅读(121)  评论(0编辑  收藏  举报