Bonsoir;
Je développe une application web utilisant Hibernate et Spring (IoC, MVC) et MySQL.
J'ai fait des test sous le console, l'interrogation de données se fait parfaitement.
Quand j'ai passé à la couche web sous Tomcat, la connexion avec MySQL via Hibernate m'affichera l'erreur suivant :
org.hibernate.exception.JDBCConnectionException: Could not open connection
voici mon fichier de configuration hibernate.cfg.xml :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| <hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/bd_gest_comptes</property>
<property name="hibernate.connection.pool_size">3</property>
<property name="hibernate.connection.autocommit">true</property>
<property name="current_session_context_class">thread</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.show_sql">true</property>
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">monPass</property>
<!--property name="hibernate.hbm2ddl.auto">create</property -->
<mapping resource="dao/entites/Client.hbm.xml" />
<mapping resource="dao/entites/Operation.hbm.xml" />
<mapping resource="dao/entites/Compte.hbm.xml" />
</session-factory>
</hibernate-configuration> |
Quelqu'un peut m'aider SVP ?
Partager