日期:2014-05-20  浏览次数:20870 次

hibernate dialect 问题
2008-10-11 1:04:24 org.hibernate.connection.UserSuppliedConnectionProvider configure
警告: No connection properties specified - the user must supply JDBC connections
org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
at org.hibernate.dialect.DialectFactory.determineDialect(DialectFactory.java:57)
at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:39)
at org.hibernate.cfg.SettingsFactory.determineDialect(SettingsFactory.java:437)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:132)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2078)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1302)
at com.hibernate.utils.HibernateTest.TestSave(HibernateTest.java:20)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:164)
at junit.framework.TestCase.runBare(TestCase.java:130)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:120)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
请各位大虾 给小弟看看 这是什么原因 数据库方言在hibernate配置文件中已经正确配置了 但是还是出现这个问题 
<session-factory>
<property name="connection.username">root</property>
<property name="connection.url">
jdbc:mysql://localhost:3306/test
</property>
<property name="dialect">
org.hibernate.dialect.MySQLDialect
</property>
<property name="myeclipse.connection.profile">
mysql
</property>
<property name="connection.password">
gf851012
</property>
<property name="hibernate.connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="show_sql">true</property>
<mapping resource="com/hibernate/dao/Events.hbm.xml" />

</session-factory>
我在线等待各位的答案 谢谢 十分感谢!!!


------解决方案--------------------
hibernate.cfg.xml 放哪了
------解决方案--------------------

------解决方案--------------------
换为以下内容试一下:
<session-factory> 
<property name="connection.username">root </property> 
<property name="connection.url"> 
jdbc:mysql://localhost:3306/test 
</property> 
<property name="dialect"> 
org.hibernate.dialect.MySQLInnoDBDialect
</property> 
<property name="myeclipse.connection.profile"> 
mysql 
</property> 
<property name="connection.password"> 
gf851012 
</property> 
<property name="hibernate.connection.driver_class">