Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the dialects of Hibernate

Shulou Source: shulou.com Published: 2022-06-02 08:00:28 09月10日 Update

This article is to share with you what the Hibernate dialect has. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

DB2's:

< bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">

< property name="driverClassName" value="com.ibm.db2.jcc.DB2Driver">

< /property>

< property name="url" value="jdbc:db2://localhost:50000/MyDB">

< /property>

< property name="username" value="sp">

< /property>

< property name="password" value="spspsp">

< /property>

< /bean>

< bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">

< property name="dataSource">

< ref bean="dataSource" />

< /property>

< property name="hibernateProperties">

< props>

< prop key="hibernate.dialect">

Org.hibernate.dialect.DB2Dialect

< /prop>

< prop key="hibernate.show_sql">

True

< /prop>

< /props>

< /property>

Sql2005: SQL2000 is about the same.

< bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">

< property name="driverClassName" value="net.sourceforge.jtds.jdbc.Driver">

< /property>

< property name="url" value="jdbc:jtds:sqlserver://192.168.1.64:1435">

< /property>

< property name="username" value="sp">

< /property>

< property name="password" value="sp">

< /property>

< /bean>

< bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">

< property name="dataSource">

< ref bean="dataSource" />

< /property>

< property name="hibernateProperties">

< props>

< prop key="hibernate.dialect">

Org.hibernate.dialect.SQLServerDialect

< /prop>

< prop key="hibernate.show_sql">

True

< /prop>

< /props>

< /property>

MySQL: 5 and 6 are about the same.

< bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">

< property name="driverClassName" value="com.mysql.jdbc.Driver">

< /property>

< property name="url" value="jdbc:mysql://localhost:3306/DBNAME?useUnicode=true&characterEncoding=gbk">

< /property>

< property name="username" value="root">

< /property>

< property name="password" value="">

< /property>

< /bean>

< bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">

< property name="dataSource">

< ref bean="dataSource" />

< /property>

< property name="hibernateProperties">

< props>

< prop key="hibernate.dialect">

Org.hibernate.dialect.MySQLDialect

< /prop>

< prop key="hibernate.show_sql">

True

< /prop>

< /props>

These are the Hibernate dialects of the three major databases. DB2 is relatively strong, mandatory password, and more than 6 digits. Otherwise, there is no need.

Thank you for reading! This is the end of this article on "what are the dialects of Hibernate?". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Tags: Dialects almost content more articles good practical strong three no passwords that is data databases articles see knowledge reference help compulsion Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi NVidia Microsoft MariaDB Docker