-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: how to configure two databases in hibernate.cfg
PostPosted: Mon Mar 15, 2004 11:28 am 
Newbie

Joined: Fri Mar 12, 2004 11:04 am
Posts: 10
Hibernate 2.1.1

hibernate.cfg :

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">

<hibernate-configuration>
<session-factory>
<property name="connection.datasource">java:comp/env/jdbc/Database1</property>
<property name="show_sql">true</property>
<property name="use_outer_join">true</property>
<property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>

<!-- Mapping files -->
<mapping resource="table1.hbm.xml" />
<mapping resource="table2.hbm.xml" />
...
</session-factory>
</hibernate-configuration>

How can I define a second connection to another database (with the same/or different JDBC driver)
Tnx!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 15, 2004 11:40 am 
Regular
Regular

Joined: Tue Oct 14, 2003 11:11 pm
Posts: 62
Location: Brasil/Curitiba
you must create another hibernate.cfg.xml and use the Configuration.configure(String resource) method.

_________________
Ricardo Lecheta


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.