DB2的:
- < 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也差不多.
- < 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和6的差不多的.
- < 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>
以上就是三大数据库的Hibernate方言。DB2的比较强悍,强制密码,并且6位以上.否则不用.
本文标题:Hibernate方言总结
网址分享:http://www.mswzjz.cn/qtweb/news46/442496.html
攀枝花网站建设、攀枝花网站运维推广公司-贝锐智能,是专注品牌与效果的网络营销公司;服务项目有等
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 贝锐智能