This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

configuring jndi lookup

san krish
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to use JNDi lookup for DataBase. Where should i specify them. Rigtnow i have given the hibernate connections in persistance xml file with user name pwd etc. But i dont want to do this. I want to use JNDI lookup and configure my weblogic for the JNDI. What are the changes I need to make in the application context and persistance xml files. Pleas help?

my persistance .xml file looks like this,

<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns=""

<persistence-unit name="jpaPersistance" transaction-type="RESOURCE_LOCAL">


<property name="hibernate.archive.autodetection" value="class, hbm"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.connection.driver_class" value="oracle.jdbc.driver.OracleDriver"/>
<property name="hibernate.connection.password" value="test"/>
<property name="hibernate.connection.url" value="jdbcracle:thin:@localhost:1521:xe"/>
<property name="hibernate.connection.username" value="test"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>



Application context looks like this,
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=""

<!-- <bean/> definitions here -->


<bean id="demoDataServiceImpl" class="" />

<bean id="recordGeneratorWebServiceHandler" class="">
<property name="service" ref="demoDataServiceImpl"/>

<bean id="entityManagerFactory"
<property name="persistenceUnitName" value="jpaPersistance"/>


<bean id="transactionManager"
class="org.springframework.orm.jpa.JpaTransactionManager" >
<property name="entityManagerFactory" ref="entityManagerFactory"/>
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic