title: Difference of Environment.DEFAULT_SCHEMA and database in Hibernate
body: <p>What is the difference in Hibernate of<br>
  <code>cfg.setProperty(Environment.DEFAULT_SCHEMA, "exampleDB");</code>  </p>
  
  <p>with<br>
  <code>&lt;property name="hibernate.connection.url"&gt;jdbc:mysql://127.0.0.1:3306/exampleDB&lt;/property&gt;</code>  </p>
  
  <p>Is default schema and DB in the connection URL completely different things?<br>
  I noticed that if I omit the setting of <code>Environment.DEFAULT_SCHEMA</code> and do the following:  </p>
  
  <pre><code>Configuration cfg = new Configuration();
  System.out.println("Default schema:"+cfg.getProperty(Environment.DEFAULT_SCHEMA));
  sessionFactory = cfg.configure().buildSessionFactory();
  </code></pre>
  
  <p>The console prints: <code>Default schema:null</code>.  </p>
  
  <p>So what is the use of <code>Environment.DEFAULT_SCHEMA</code> and the difference with the connecting DB?  </p>