關於Hibernate+Mysql8.0的方言注意

<!DOCTYPE hibernate-configuration PUBLIC
	"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
	"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
	<session-factory>
	<property name="hibernate.connection.driver_class">com.mysql.cj.jdbc.Driver</property>
	<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/myy?useSSL=false&amp;serverTimezone=UTC</property>
	<property name="hibernate.connection.username">root</property>
	<property name="hibernate.connection.password">root</property>
	
	<!-- 設置方言************************* -->
	<property name="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</property>
	
	<!-- 自動建表 -->
	<property name="hibernate.hbm2ddl.auto">update</property>
	
	<!-- 顯示SQL -->
	<property name="hibernate.show_sql">true</property>
	
	<!-- 格式化SQL -->
	<property name="hibernate.format_sql">true</property>

		<!--指定關聯的 。hbm。xml文件 -->
		<mapping resource="com/user.hbm.xml"></mapping>
	</session-factory>
</hibernate-configuration>

發佈了59 篇原創文章 · 獲贊 248 · 訪問量 12萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章