diff --git a/spring-hibernate4/pom.xml b/spring-hibernate4/pom.xml
index be921ecef9..ad9bd7f4bb 100644
--- a/spring-hibernate4/pom.xml
+++ b/spring-hibernate4/pom.xml
@@ -24,7 +24,7 @@
-
+
org.springframework
spring-orm
@@ -47,6 +47,12 @@
runtime
+
+ org.apache.tomcat
+ tomcat-dbcp
+ 7.0.41
+
+
diff --git a/spring-hibernate4/src/main/java/org/baeldung/spring/PersistenceConfig.java b/spring-hibernate4/src/main/java/org/baeldung/spring/PersistenceConfig.java
index ac148859cc..f66e554316 100644
--- a/spring-hibernate4/src/main/java/org/baeldung/spring/PersistenceConfig.java
+++ b/spring-hibernate4/src/main/java/org/baeldung/spring/PersistenceConfig.java
@@ -4,6 +4,7 @@ import java.util.Properties;
import javax.sql.DataSource;
+import org.apache.tomcat.dbcp.dbcp.BasicDataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
@@ -11,7 +12,6 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.core.env.Environment;
import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor;
-import org.springframework.jdbc.datasource.DriverManagerDataSource;
import org.springframework.orm.hibernate4.HibernateTransactionManager;
import org.springframework.orm.hibernate4.LocalSessionFactoryBean;
import org.springframework.transaction.annotation.EnableTransactionManagement;
@@ -43,7 +43,7 @@ public class PersistenceConfig {
@Bean
public DataSource restDataSource() {
- final DriverManagerDataSource dataSource = new DriverManagerDataSource();
+ final BasicDataSource dataSource = new BasicDataSource();
dataSource.setDriverClassName(Preconditions.checkNotNull(env.getProperty("jdbc.driverClassName")));
dataSource.setUrl(Preconditions.checkNotNull(env.getProperty("jdbc.url")));
dataSource.setUsername(Preconditions.checkNotNull(env.getProperty("jdbc.user")));
diff --git a/spring-hibernate4/src/main/resources/hibernate4Config.xml b/spring-hibernate4/src/main/resources/hibernate4Config.xml
index f35de2a4c5..fc49652554 100644
--- a/spring-hibernate4/src/main/resources/hibernate4Config.xml
+++ b/spring-hibernate4/src/main/resources/hibernate4Config.xml
@@ -19,7 +19,7 @@
-
+