<hibernate-configuration>
<session-factory> <property name="hibernate.connection.driver_class">
com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">
jdbc:mysql://localhost/products</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password"></property>
<property name="hibernate.connection.pool_size">10</property>
<property name="show_sql">true</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<!-- Mapping files -->
<mapping resource="prod.hbm.xml"/>
</session-factory>
</hibernate-configuration>
i am using the above XML as hibernate config file to insert into my database named "Products" some data.
But it displays a compile error:Connection cannot be null when 'hibernate.dialect' not set
I have no idea why/how to fix. Could some of you offer me some ideas to move on ? I am grateful. Thank you.
[UPDATE]
I think I should include steps in which I created and set up my simple project, I guess it might be the cause
I already had DB and table in mysql; I then created a empty java project, I added source file (java extensions), then I added 2 xml files (hibernate.cfg.xml and prod.hbm.xml). Then I just compiled in hope that I would run.
And here is the message I have got from commmand prompt after trying to run my application as a java application
Jul 13, 2012 12:32:55 PM org.hibernate.annotations.common.Version <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
Jul 13, 2012 12:32:55 PM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {4.1.2.Final}
Jul 13, 2012 12:32:55 PM org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
Jul 13, 2012 12:32:55 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
Jul 13, 2012 12:32:56 PM org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator initiateService
WARN: HHH000181: No appropriate connection provider encountered, assuming application will be supplying connections
Connection cannot be null when 'hibernate.dialect' not set