Bonjour,
Je suis nouvel utilisateur de hibernate. J'ai créé un projet d'essai suivant les tuto mais à l'exécution, j'ai une exception du type : java.sql.SQLException: No suitable driver found for http://.........
J'utilise eclipse et postgreSql . Comme indiqué, j'ai rajouté les jar qu'il faut y compris ceux du driver : postgresql-8.2dev-503.jdbc3.jar et postgresql-8.3-603.jdbc4.jar.
J'ai fait pas mal de recherches sur le net pour m'en sortir mais initule. Je mets ci dessous mon fichier de configuration hibernate :
Merci par avance !
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50 <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <!-- Generated by MyEclipse Hibernate Tools. --> <hibernate-configuration> <session-factory> <!-- PostgreSQL connection --> <property name="connection.url">http://MonUrl</property> <property name="connection.username">user</property> <property name="connection.password">pass</property> <property name="connection.driver_class">org.postgresql.Driver</property> <property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property> <!-- <property name="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property> --> <!-- thread is the short name for org.hibernate.context.ThreadLocalSessionContext and let Hibernate bind the session automatically to the thread --> <property name="current_session_context_class">thread</property> <!-- this will show us all sql statements --> <property name="hibernate.show_sql">true</property> <!-- this will create the database tables for us --> <!-- <property name="hibernate.hbm2ddl.auto">create</property> --> <property name="hibernate.hbm2ddl.auto">update</property> <!-- Use the C3P0 connection pool. --> <property name="c3p0.min_size">3</property> <property name="c3p0.max_size">5</property> <property name="c3p0.timeout">1800</property> <!-- Disable second-level cache. --> <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property> <property name="cache.use_query_cache">false</property> <property name="cache.use_minimal_puts">false</property> <property name="max_fetch_depth">3</property> <mapping resource="de/laliluna/example/Honey.hbm.xml" /> <!-- <mapping class="de.laliluna.example.Honey" />--> </session-factory> </hibernate-configuration>
Partager