Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the dialects of Hibernate

2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report