title: Hibernate configuration file
body: <p>It seems that I have a problem with my configuration file but I really don't find out what it could be.</p>
  
  <p>I used to use hibernate 3.6, I now use hibernate 4.2, there are proly some important changes that I ignore, but the doc seems to not change this part.</p>
  
  <p>Here is my configuration file:</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='utf-8'?&gt;
  &lt;!DOCTYPE hibernate-configuration PUBLIC
  "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
  "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"&gt;
  
  &lt;hibernate-configuration&gt;
      &lt;session-factory&gt;
          &lt;!-- Database connection settings --&gt;
          &lt;property name="connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;
          &lt;property name="connection.url"&gt;jdbc:mysql://localhost/Test&lt;/property&gt;
          &lt;property name="connection.username"&gt;root&lt;/property&gt;
          &lt;property name="connection.password"&gt;*****&lt;/property&gt;
  
          &lt;!-- JDBC connection pool (use the built-in) --&gt;
          &lt;property name="connection.pool_size"&gt;10&lt;/property&gt;
          &lt;property name="maxActive" value="10" /&gt;
  
          &lt;!-- SQL dialect --&gt;
          &lt;property name="dialect"&gt;org.hibernate.dialect.MySQL5Dialect&lt;/property&gt;
  
          &lt;!-- Enable Hibernate's automatic session context management --&gt;
          &lt;property name="current_session_context_class"&gt;thread&lt;/property&gt;
  
          &lt;!-- Disable the second-level cache  --&gt;
          &lt;property name="cache.provider_class"&gt;org.hibernate.cache.internal.NoCacheProvider&lt;/property&gt;
  
          &lt;!-- Echo all executed SQL to stdout --&gt;
          &lt;property name="show_sql"&gt;true&lt;/property&gt;
  
          &lt;!-- Drop and re-create the database schema on startup --&gt;
          &lt;property name="hbm2ddl.auto"&gt;create&lt;/property&gt;
  
        &lt;!-- Mapping files --&gt;
        &lt;mapping resource="database/config/mapping/test.hbm.xml"/&gt;
      &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>And here is my java source:</p>
  
  <pre><code>public class CreateDB {
      public static void main(String argv[]){
          try {
              Configuration configuration = new Configuration();
              configuration.configure("database/config/DBCreate.cfg.xml");
              ServiceRegistryBuilder serviceRegistryBuilder = new ServiceRegistryBuilder().applySettings(configuration
                  .getProperties());
              SessionFactory sessionFactory = configuration
                  .buildSessionFactory(serviceRegistryBuilder.buildServiceRegistry());
          DBConnect.Disconnect(null, sessionFactory.openSession()); // Just logout from a session
          } catch (Exception e) {
              System.out.println("Database unreachable.");
          }
      }
  }
  </code></pre>
  
  <p>And here is the return statement:</p>
  
  <pre><code>mai 02, 2013 11:41:59 AM org.hibernate.annotations.common.Version &lt;clinit&gt;
  INFO: HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
  mai 02, 2013 11:41:59 AM org.hibernate.Version logVersion
  INFO: HHH000412: Hibernate Core {4.2.0.Final}
  mai 02, 2013 11:41:59 AM org.hibernate.cfg.Environment &lt;clinit&gt;
  INFO: HHH000206: hibernate.properties not found
  mai 02, 2013 11:41:59 AM org.hibernate.cfg.Environment buildBytecodeProvider
  INFO: HHH000021: Bytecode provider name : javassist
  mai 02, 2013 11:41:59 AM org.hibernate.cfg.Configuration configure
  INFO: HHH000043: Configuring from resource: database/config/DBCreate.cfg.xml
  mai 02, 2013 11:41:59 AM org.hibernate.cfg.Configuration getConfigurationInputStream
  INFO: HHH000040: Configuration resource: database/config/DBCreate.cfg.xml
  Database unreachable.
  </code></pre>
  
  <p>I really don't get what is wrong, maybe someone will be able to enlight me.
  Sorry for possible disturbance and if my post isn't adapted, this is my first one.</p>
  
  <p>Best regards.</p>