Hibernate连接数据库配置参数

Mysql

hibernate.dialect = org.hibernate.dialect.MySQLDialect
connection.driver_class = com.mysql.jdbc.Driver
connection.url = jdbc:mysql://localhost:3306/test
connection.username = 用户名
connection.password = 密码

Mysql解决乱码:url后加参数:jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8

 

Oracle 11g

hibernate.dialect = org.hibernate.dialect.OracleDialect
hibernate.connection.driver_class = oracle.jdbc.OracleDriver
hibernate.connection.username = 用户名
hibernate.connection.password = 密码
hibernate.connection.url = jdbc:oracle:thin:@localhost:1521:orcl

posted @ 2016-08-24 17:56  EdisonLi  阅读(518)  评论(0)    收藏  举报