hibernate.cfg.xml文件连接mySql、Oracle、SqlServer配置
来源:互联网 发布:卡卡的淘宝店 编辑:程序博客网 时间:2024/05/21 10:23
1.连接mySql,文件配置如下:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.url">
jdbc:mysql://localhost:3306/test
</property>
<property name="connection.username">root</property>
<property name="connection.password">253503125</property>
<property name="connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="dialect">
org.hibernate.dialect.MySQLDialect
</property>
<property name="show_sql">true</property>
</session-factory>
</hibernate-configuration>
2.连接Oracle,文件配置如下:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.url">jdbc:oracle:thin:@192.168.7.248:1521:orcl</property>
<property name="connection.username">liferay</property>
<property name="connection.password">liferay</property>
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="show_sql">true</property>
</session-factory>
</hibernate-configuration>
3.连接sqlServer,问津配置如下:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.url">jdbc:sqlserver://192.168.7.199:1433;databaseName=xycms</property>
<property name="connection.username">sa</property>
<property name="connection.password">123456</property>
<property name="connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
<property name="dialect">org.hibernate.dialect.SQLServerDialect</property>
<property name="show_sql">true</property>
</session-factory>
</hibernate-configuration>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.url">
jdbc:mysql://localhost:3306/test
</property>
<property name="connection.username">root</property>
<property name="connection.password">253503125</property>
<property name="connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="dialect">
org.hibernate.dialect.MySQLDialect
</property>
<property name="show_sql">true</property>
</session-factory>
</hibernate-configuration>
2.连接Oracle,文件配置如下:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.url">jdbc:oracle:thin:@192.168.7.248:1521:orcl</property>
<property name="connection.username">liferay</property>
<property name="connection.password">liferay</property>
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="show_sql">true</property>
</session-factory>
</hibernate-configuration>
3.连接sqlServer,问津配置如下:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.url">jdbc:sqlserver://192.168.7.199:1433;databaseName=xycms</property>
<property name="connection.username">sa</property>
<property name="connection.password">123456</property>
<property name="connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
<property name="dialect">org.hibernate.dialect.SQLServerDialect</property>
<property name="show_sql">true</property>
</session-factory>
</hibernate-configuration>
0 0
- hibernate.cfg.xml文件连接mySql、Oracle、SqlServer配置
- hibernate.cfg.xml文件连接mySql、Oracle、SqlServer配置
- hibernate学习(一)hibernate.cfg.xml文件连接mySql、Oracle、SqlServer配置
- Hibernate.cfg.xml 配置连接MySQL数据库
- hibernate+sqlserver2005连接对hibernate.cfg.xml文件的配置
- hibernate.cfg.xml配置文件,连接oracle数据库和mysql 数据库
- hibernate.cfg.xml配置Mysql连接字符串时提示错误
- 连接Oracle数据库的Hibernate.cfg.xml
- 连接Oracle数据库的Hibernate.cfg.xml
- 连接MySQL数据库的Hibernate.cfg.xml
- hibernate.cfg.xml配置oracle9i连接
- 使用hibernate连接mysql数据库正向工程hibernate.cfg.xml文件和xxx.hbm.xml配置文件
- Hibernate连接SQL Server2008时候hibernate.cfg.xml和table.hbm.xml文件的配置详情
- java 使用hibernate访问sqlserver如何配置hibernate.cfg.xml
- hibernate.cfg.xml配置mysql数据库信息
- spring集成hibernate.cfg.xml连接sqlserver的配置文件
- 《转》怎样配置Hibernate.cfg.xml文件
- hibernate.cfg.xml文件的配置
- thrift常见数据类型
- Hibernate.cfg.xml 配置连接MySQL数据库
- Linux下安装Tomcat服务器和部署Web应用
- Android中简单网络判断
- Your binary is not optimized for iPhone 5” (ITMS-90096) when submitting
- hibernate.cfg.xml文件连接mySql、Oracle、SqlServer配置
- WebLogic使用总结(三)——WebLogic配置JNDI数据源
- JavaWeb学习总结(五十)——文件上传和下载
- hibernate.cfg.xml配置总结(转载)
- win8操作系统下使用telnet客户端
- swift中关于boundingRect 的一个坑
- 笔试面试算法经典--连续子数组的最大乘积及连续子数组的最大和(Java)
- 计算机管理中的Oralce11g服务
- JavaWeb学习总结(五十一)——邮件的发送与接收原理