码迷,mamicode.com
首页 > 数据库 > 详细

连接oracle和mysql数据库

时间:2016-10-22 17:40:26      阅读:177      评论:0      收藏:0      [点我收藏+]

标签:username   hbm   connect   nec   res   person   nbsp   factor   lips   

<?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">

<!-- Generated by MyEclipse Hibernate Tools. -->
<hibernate-configuration>

<!--  连接mysql -->
<session-factory>
<property name="dialect">
org.hibernate.dialect.MySQLDialect
</property>
<property name="connection.url">
jdbc:mysql://localhost:3306/oa1
</property>
<property name="connection.username">root</property>
<property name="connection.password">123456</property>
<property name="connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="eclipse.connection.profile">mysql</property>
<property name="show_sql">true</property>
<property name="hbm2ddl.auto">update</property>
<mapping resource="com/oa/domain/Person.hbm.xml" />
</session-factory>

<!-- 连接oracle -->
<session-factory>
<property name="dialect">
org.hibernate.dialect.Oracle10gDialect
</property>
<property name="connection.url">
jdbc:oracle:thin:@LOCALHOST:1521:ORCL
</property>
<property name="connection.username">oa1</property>
<property name="connection.password">oa1</property>
<property name="connection.driver_class">
oracle.jdbc.driver.OracleDriver
</property>
<property name="eclipse.connection.profile">oracle</property>
<property name="show_sql">true</property>
<property name="hbm2ddl.auto">update</property>

<mapping resource="com/oa/domain/Person.hbm.xml" />
</session-factory>
</hibernate-configuration>

连接oracle和mysql数据库

标签:username   hbm   connect   nec   res   person   nbsp   factor   lips   

原文地址:http://www.cnblogs.com/dengyuqing/p/5987852.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!