配置数据源
今天在搭框架的时候莫名遇到了 如下问题:


原因是 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());
}
}
无论如何,心平气和。

浙公网安备 33010602011771号