title: Hibernate - MySQL - Connection to DB
body: <p>I'm trying to connect to a MySQL database using Hibernate 3.6.10 with NetBeans 7.4, but when I try to create a new "Hibernate Mapping Wizard" I reply this error message:</p>
  
  <pre><code>Unable to connect: Cannot establish a connection jdbc:mysql://localhost:3306/mydbname using apache.org.derby.jdbc.ClientDriver(Unable to find a suitable driver)
  </code></pre>
  
  <p>This is my "hibernate.cfg.xml" 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://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"&gt;
  &lt;hibernate-configuration&gt;
    &lt;session-factory&gt;
      &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt;
      &lt;property name="hibernate.connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;
      &lt;property name="hibernate.connection.url"&gt;jdbc:mysql://localhost:3306/database&lt;/property&gt;
      &lt;property name="hibernate.connection.username"&gt;username&lt;/property&gt;
      &lt;property name="hibernate.connection.password"&gt;password&lt;/property&gt;
    &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>I've found another similar problem here: <a href="https://stackoverflow.com/questions/15600101/hibernate-cannot-connect-to-db">Hibernate - Cannot connect to DB</a> but I still not understand what's wrong.</p>
  
  <p>Best regards.<br>
  Andrea</p>