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.  [ 4 posts ] 
Author Message
 Post subject: Websphere 6, DB2 and JNDI
PostPosted: Fri Jul 21, 2006 8:55 am 
Newbie

Joined: Wed Mar 01, 2006 3:52 pm
Posts: 5
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.0

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:

what are the settings for Hibernate configuration xml to enable JNDI lookup for a DB2 datasource running under IBM Websphere (RAD) 6?
I have used the following property settings in the config.xml without success.

<property name="connection.driver_class">com.ibm.db2.jcc.DB2Driver</property>
<property name="hibernate.connection.datasource">jdbc/JNDINAME</property>


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 21, 2006 10:01 am 
Newbie

Joined: Fri Jul 21, 2006 6:27 am
Posts: 10
hi!

im not exactly sure if that helps, but have you had a look at the examples in the hibernate properties file?

chris
p.s.: there are some more jndi options than posted below, so you best read the whole properties file.

Code:
## JNDI Datasource

#hibernate.connection.datasource jdbc/test
#hibernate.connection.username db2
#hibernate.connection.password db2

Code:
############
### JNDI ###
############

## specify a JNDI name for the SessionFactory

#hibernate.session_factory_name hibernate/session_factory


## Hibernate uses JNDI to bind a name to a SessionFactory and to look up the JTA UserTransaction;
## if hibernate.jndi.* are not specified, Hibernate will use the default InitialContext() which
## is the best approach in an application server

#file system
#hibernate.jndi.class com.sun.jndi.fscontext.RefFSContextFactory
#hibernate.jndi.url file:/

#WebSphere
#hibernate.jndi.class com.ibm.websphere.naming.WsnInitialContextFactory
#hibernate.jndi.url iiop://localhost:900/


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 24, 2006 9:57 am 
Newbie

Joined: Wed Mar 01, 2006 3:52 pm
Posts: 5
Thanks very much for your response. Yes I am aware of that setting page. We actually tried the initialcontext setting without success.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 24, 2006 12:23 pm 
Senior
Senior

Joined: Wed Aug 17, 2005 12:56 pm
Posts: 136
Location: Erie, PA (USA)
I'm using WAS 5.

hibernate.connection.datasource=java:comp/env/myDataSource

That's it. No driver class as the data source provides it. I use JAAS for security.

Good luck,
Curtis ...

_________________
---- Don't forget to rate! ----


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.