-->
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: Do i need to change my code if i use a datasource?
PostPosted: Wed Aug 30, 2006 8:45 am 
Newbie

Joined: Mon Aug 28, 2006 10:59 am
Posts: 2
Hi there, i configured my datasource properly in TOMCAT and here is my hibernate.cfg.xml file:

<hibernate-configuration>

<session-factory>

<property name="connection.datasource">java:comp/env/jdbc/inouk</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>

<!--### Apache DBCP Connection Pool ###-->
<!--connection pool-->
<property name="hibernate.dbcp.maxActive">10</property>
<property name="hibernate.dbcp.whenExhaustedAction">1</property>
<property name="hibernate.dbcp.maxWait">180</property>
<property name="hibernate.dbcp.maxIdle">10</property>

<mapping resource="mapping/Departement.hbm.xml" />
<mapping resource="mapping/Poste.hbm.xml" />
<mapping resource="mapping/Staff.hbm.xml" />
<mapping resource="mapping/Menu.hbm.xml" />
<mapping resource="mapping/Login.hbm.xml" />
<mapping resource="mapping/Nouvelles.hbm.xml" />
<mapping resource="mapping/Promotion.hbm.xml" />
<mapping resource="mapping/Equipe.hbm.xml" />
<mapping resource="mapping/Joueur.hbm.xml" />
<mapping resource="mapping/Equipejoueur.hbm.xml" />
<mapping resource="mapping/Equipestaff.hbm.xml" />
<mapping resource="mapping/Fan.hbm.xml" />
<mapping resource="mapping/Partie.hbm.xml" />
<mapping resource="mapping/Partenaire.hbm.xml" />

</session-factory>

</hibernate-configuration>

All this configurations works for me...but now i wonder if i must change my hibernate code to acess the session and do my stuff...do i need to call explicitly my datasource are all is done behind the scene with the hibernate.cfg.xml?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 08, 2006 7:39 am 
Beginner
Beginner

Joined: Fri Sep 08, 2006 7:29 am
Posts: 36
All is done behind the scenes by Hibernate.

**You could have just started the application and tested it. :)

Br,
Shardul.


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.