<!--MySql 驱动程序 eg. mysql-connector-java-5.0.4-bin.jar-->
  <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
  <property name="connection.driver_class">com.mysql.jdbc.Driver</property>

<!-- JDBC URL -->
  <property name="connection.url">jdbc:mysql://localhost/dbname?characterEncoding=gb2312</property>

<!-- 数据库用户名-->
  <property name="connection.username">root</property>

<!-- 数据库密码-->
  <property name="connection.password">root</property>
  
  
  <!--Sql Server 驱动程序 eg. jtds-1.2.jar-->
  <property name="dialect">org.hibernate.dialect.SQLServerDialect</property>
  <property name="connection.driver_class">net.sourceforge.jtds.jdbc.Driver</property>

<!-- JDBC URL -->
  <property name="connection.url">jdbc:jtds:sqlserver://localhost:1433;DatabaseName=dbname</property>

<!-- 数据库用户名-->
  <property name="connection.username">sa</property>

<!-- 数据库密码-->
  <property name="connection.password"></property>

<!--Oracle 驱动程序 ojdbc14.jar-->
  <property name="dialect">org.hibernate.dialect.OracleDialect</property>
  <property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>

<!-- JDBC URL -->
  <property name="connection.url">jdbc:oracle:thin:@localhost:1521:dbname</property>

<!-- 数据库用户名-->
  <property name="connection.username">test</property>

<!-- 数据库密码-->
  <property name="connection.password">test</property>

如果出现如下错误,则可能是Hibernate SQL方言 (hibernate.dialect)设置不正确。
Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]'last_insert_id' 不是可以识别的 函数名。

RDBMS 方言
DB2 org.hibernate.dialect.DB2Dialect
DB2 AS/400 org.hibernate.dialect.DB2400Dialect
DB2 OS390 org.hibernate.dialect.DB2390Dialect
PostgreSQL org.hibernate.dialect.PostgreSQLDialect
MySQL org.hibernate.dialect.MySQLDialect
MySQL with InnoDB org.hibernate.dialect.MySQLInnoDBDialect
MySQL with MyISAM org.hibernate.dialect.MySQLMyISAMDialect
Oracle (any version) org.hibernate.dialect.OracleDialect
Oracle 9i/10g org.hibernate.dialect.Oracle9Dialect
Sybase org.hibernate.dialect.SybaseDialect
Sybase Anywhere org.hibernate.dialect.SybaseAnywhereDialect
Microsoft SQL Server org.hibernate.dialect.SQLServerDialect
SAP DB org.hibernate.dialect.SAPDBDialect
Informix org.hibernate.dialect.InformixDialect
HypersonicSQL org.hibernate.dialect.HSQLDialect
Ingres org.hibernate.dialect.IngresDialect
Progress org.hibernate.dialect.ProgressDialect
Mckoi SQL org.hibernate.dialect.MckoiDialect
Interbase org.hibernate.dialect.InterbaseDialect
Pointbase org.hibernate.dialect.PointbaseDialect
FrontBase org.hibernate.dialect.FrontbaseDialect
Firebird org.hibernate.dialect.FirebirdDialect

Hibernate 不同数据库的连接及SQL方言的更多相关文章

  1. [转]Hibernate不能自动建表解决办法及Hibernate不同数据库的连接及SQL方言

    最近开始学Hibernate,看的是李刚的那本<轻量级java ee企业应用实战>.头一个hibernate程序,我原原本本的按照书上例子写下来,同时只是改动了些mysql的连接参数,并且 ...

  2. Hibernate不同数据库的连接及SQL方言

    本文讲述Hibernate不同数据库的连接及SQL方言.Hibernate不同数据库的连接可能会出现错误,有一种情况是由于Hibernate SQL方言设置不正确而导致的. 以下代码展示Hiberna ...

  3. R语言︱ 数据库SQL-R连接与SQL语句执行(RODBC、sqldf包)

    要学的东西太多,无笔记不能学~~ 欢迎关注公众号,一起分享学习笔记,记录每一颗"贝壳"~ --------------------------- 数据库是极其重要的R语言数据导入源 ...

  4. jsp_数据库的连接

    一.添加数据库以及表 在这里我们使用的是mysql数据库 二.配置数据库的驱动程序 将mysql的驱动程序复制到Tomcat目录下的lib目录中 注:在Tomcat中如果配置了新的jar包,则配置完成 ...

  5. Hibernate SQL方言 (hibernate.dialect) Spring配置文件applicationContext.xml

    转自:http://www.cnblogs.com/wj-wangjun/archive/2009/10/21/1587624.html Hibernate SQL方言 (hibernate.dial ...

  6. hibernate4中oracle,sqlserver,mysql数据库的sql方言配置(SQL Dialects)

    hibernate4中oracle,mysql,sqlserver数据库的sql方言配置(SQL Dialects) 数据库类型 Hibernate sql方言 DB2 org.hibernate.d ...

  7. Jmeter—8 连接microsoft sql server数据库取数据

    本文以Jmeter 连接microsoft sql server为例. 1 从微软官网下载Microsoft SQL Server JDBC Driver 地址:http://www.microsof ...

  8. C# 连接SQL数据库 常用连接字符串

    一:C# 连接SQL数据库 Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myP ...

  9. Hibernate不同数据库 方言|驱动|url 配置

    Hibernate不同数据库方言|驱动|url mySql: hibernate.dialect : org.hibernate.dialect.MySQLDialect driverClassNam ...

随机推荐

  1. SQL注入使用Django中继数据包bypassWAF

    原理 本人基于文章bypassword的文章在HTTP协议层面绕过WAF所编写一款工具. 环境 Python3.7.0 Django 2.1 Requests 使用范围 POST注入 可以分块传输的漏 ...

  2. CSUOJ 1270 Swap Digits

    Description ) in the first line, which has the same meaning as above. And the number is in the next ...

  3. iOS Sprite Kit教程之真机测试以及场景的添加与展示

    iOS Sprite Kit教程之真机测试以及场景的添加与展示 IOS实现真机测试 在进行真机测试之前,首先需要确保设备已经连在了Mac(或者Mac虚拟机)上,在第1.9.1小节开始,设备就一直连接在 ...

  4. luoguP4336 [SHOI2016]黑暗前的幻想乡 容斥原理 + 矩阵树定理

    自然地想到容斥原理 然后套个矩阵树就行了 求行列式的时候只有换行要改变符号啊QAQ 复杂度为\(O(2^n * n^3)\) #include <cstdio> #include < ...

  5. [POJ1082]Calendar Game

    题目大意: 日历上博弈,从给定的日期,按照下述规则跳转日期: 1.跳到第二天: 2.调到下个月相同的日期(如果没有就不能跳转). 刚刚好跳到2001年11月4日的人胜,跳转时不能跳到2001年11月4 ...

  6. Codeforces Round #313 (Div. 1) C. Gerald and Giant Chess DP

    C. Gerald and Giant Chess Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest ...

  7. CSS3制作ajax loader icon

    demo 本文用到的两个CSS3属性:transform.animation 一.HTML <div class="ajax-loading"> <div cla ...

  8. Go语言Web框架gwk介绍 (二)

    HttpResult 凡是实现了HttpResult接口的对象,都可以作为gwk返回Web客户端的内容.HttpResult接口定义非常简单,只有一个方法: type HttpResult inter ...

  9. Comparable<T> 和 Comparator<T>

    相同点: Comparable<T> 和 Comparator<T>都是接口 不同点: 两者声明的方法不同.前者是compareTo()方法,后者是compare()方法. C ...

  10. SpringBoot无法启动,Process finished with exit code 0

    1.排查yml和properties文件是否配置错误 2.排查POM引入的包