title: Hibernate doesn't want to load Oracle driver
body: <p>I downloaded Hibernate 4.1.2 and am using Oracle Database 10g Release 2. The JDBC driver I am using is <code>ojdbc14.jar</code>.</p>
  
  <p>I set up HibernateUtil class as:</p>
  
  <pre><code>public class HibernateUtil {
      private static final SessionFactory sessionFactory = buildSessionFactory();
  
      private static SessionFactory buildSessionFactory() {
          // Create the SessionFactory from hibernate.cfg.xml
          try{
              Configuration configuration = new Configuration();
              configuration.configure();
              ServiceRegistry serviceRegistry = new ServiceRegistryBuilder().applySettings(configuration.getProperties()).buildServiceRegistry();        
              return configuration.buildSessionFactory(serviceRegistry);
          }catch(HibernateException ex){
              ex.printStackTrace();
              throw ex;
          }
      }
  
      public static SessionFactory getSessionFactory() {
          return sessionFactory;
      }
  }
  </code></pre>
  
  <p>In <code>hibernate.properties</code> I have:</p>
  
  <pre><code>hibernate.dialect org.hibernate.dialect.OracleDialect
  hibernate.connection.driver_class oracle.jdbc.driver.OracleDriver
  hibernate.connection.username HR
  hibernate.connection.password HR
  hibernate.connection.url jdbc:oracle:thin:@localhost:1521/xe
  </code></pre>
  
  <p>But Hibernate doesn't want to load the driver. It throws an exception saying 'No appropriate driver found'.</p>
  
  <p>I tried to load the driver with <code>Class.forName("oracle.jdbc.driver.OracleDriver");</code> and it works fine.</p>