Salut,
svp c'est quoi le nom du driver utilisé par hibernate pour Mysql
merci
Salut,
svp c'est quoi le nom du driver utilisé par hibernate pour Mysql
merci
Bonjour,
Le nom du driver dépend du driver que tu as ajouté dans tes librairies. Il faut que tu recherche dans les packages du .jar de ton driver où il est.
Si c'est celui fourni par mysql normalement "com.mysql.jdbc.Driver" devrait fonctionner.
salut,
il se trouve pas ds le dossier lib d'hibernate
je précise ce que je veux faire : ds un tuto on dit qu'il faut faire
New > Other" et choissez "Hibernate > Hibernate Configuration File"
sauf qu'il donne ds le champs Driver class un driver pour sql Server, donc je me demande c'est koi le driver mysql.
pour com.mysql.jdbc.Driver c'est ce qu'on utilise avec JDBC ,quand je le rentre ds Driver class il est pas reconnu
merci
Ce que j'ai fait, j'ai generer le fichier xml et j'ai modifié moi même le driver en
a votre avis je peux faire ça
Code : Sélectionner tout - Visualiser dans une fenêtre à part <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
donc mon fichier devien
mais il siganle une erreur sur session-factory.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd"> <hibernate-configuration> <session-factory > <!-- local connection properties --> <property name="hibernate.connection.url">jdbc:mysql://localhost/agp</property> <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> <property name="hibernate.connection.username">root</property> <property name="hibernate.connection.password"></property> <!-- property name="hibernate.connection.pool_size"></property --> <!-- dialect for MySQL --> <property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property> <property name="hibernate.show_sql">false</property> <property name="hibernate.use_outer_join">true</property> <property name="hibernate.transaction.factory_class">net.sf.hibernate.transaction.JTATransactionFactory</property> <property name="jta.UserTransaction">java:comp/UserTransaction</property> </session-factory> </hibernate-configuration>
Ce que j'ai fait, j'ai generer le fichier xml et j'ai modifié moi même le driver en
a votre avis je peux faire ça
Code : Sélectionner tout - Visualiser dans une fenêtre à part <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
donc mon fichier devien
mais il siganle une erreur sur session-factory.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd"> <hibernate-configuration> <session-factory > <!-- local connection properties --> <property name="hibernate.connection.url">jdbc:mysql://localhost/agp</property> <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> <property name="hibernate.connection.username">root</property> <property name="hibernate.connection.password"></property> <!-- property name="hibernate.connection.pool_size"></property --> <!-- dialect for MySQL --> <property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property> <property name="hibernate.show_sql">false</property> <property name="hibernate.use_outer_join">true</property> <property name="hibernate.transaction.factory_class">net.sf.hibernate.transaction.JTATransactionFactory</property> <property name="jta.UserTransaction">java:comp/UserTransaction</property> </session-factory> </hibernate-configuration>
Fais voir la trace complete de l'erreur.
Partager