Oracle连接配置
hibernate.dialect = org.hibernate.dialect.OracleDialect
driverClassName = oracle.jdbc.driver.OracleDriver
jdbc_url = jdbc:oracle:thin:@localhost:1521:dbname
jdbc_username = test
jdbc_password = test
相关的jar包(ojdbc14.jar)
MySql连接配置
hibernate.dialect = org.hibernate.dialect.MySQLDialect
driverClassName = com.mysql.jdbc.Driver
jdbc_url = jdbc:mysql://localhost:3306/sshf?useUnicode=true&characterEncoding=utf-8
jdbc_username = test
jdbc_password = test
Sql Server连接配置
hibernate.dialect = org.hibernate.dialect.SQLServerDialect
driverClassName = net.sourceforge.jtds.jdbc.Driver
jdbc_url = jdbc:jtds:sqlserver://localhost:1433;DatabaseName=dbname
jdbc_username = test
jdbc_password = test
上例的驱动类使用的是jtds的驱动类,jtds的jar包(eg. jtds-1.2.jar)
DB2连接配置
hibernate.dialect = org.hibernate.dialect.DB2Dialect
driverClassName = com.ibm.db2.jdbc.app.DB2Driver
jdbc_url = jdbc:db2://localhost:5000/sample
jdbc_username = test
jdbc_password = test
上例使用的驱动类为:com.ibm.db2.jdbc.app.DB2Driver,相关的jar包(db2jcc.jar)
sybase连接配置
hibernate.dialect = org.hibernate.dialect.SybaseAnywhereDialect
driverClassName = com.sybase.jdbc.SybDrive
jdbc_url = jdbc:sybase:Tds:localhost:5007/myDB
jdbc_username = test
jdbc_password = test
上例使用的驱动类为:com.sybase.jdbc.SybDrive,相关的jar包(jconn3.jar)
PostgreSQL连接配置
hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
driverClassName = org.postgresql.Driver
jdbc_url = jdbc:postgresql://localhost/myDB
jdbc_username = test
jdbc_password = test
上例使用的驱动类为:com.informix.jdbc.IfxDrive,相关的jar包(postgresql-8.1-405.jdbc3)
转载于:https://blog.youkuaiyun.com/zhang289202241/article/details/68062008