Win a copy of Spark in Action this week in the Open Source Projects forum!
    Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Spring - How to read persistence.xml

 
Greenhorn
Posts: 27
Spring Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
Can some body please help how to read tomcat conf/context.xml resources persistence.xml Spring?
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
I actually couldn't understand what the question is. Can you explain a bit more? Since this isn't related to EJB, I've moved it to "Spring" forum which looked like the relevant forum (but it depends on what exactly you are looking for).
 
sreekanth aleddulla
Greenhorn
Posts: 27
Spring Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
i want to read tomcat conf/context.xml resources using persistence.xml Spring and i am using oracle toplink?
 
sreekanth aleddulla
Greenhorn
Posts: 27
Spring Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
ya thanks for your reply

Actually my problem is i want to read database resources from tomcat/conf/context.xml using persistence.xml i am using toplink oracle.
 
Rancher
Posts: 377
Android Spring Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hey,

In that case you don't want to read the context.xml file, but you need to refer to your Tomcat datasource via JNDI in your Spring configuration.

Sean
 
sreekanth aleddulla
Greenhorn
Posts: 27
Spring Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
Ok thanks can you please see below

i want to read this resource from spring persistence.xml please give me some example how to do .

<Resource name="jdbc/ISM_rep_user"
auth="Container"
type="javax.sql.DataSource"
removeAbandoned="true"
removeAbandonedTimeout="60"
logAbandoned="true"
maxActive="10"
maxIdle="5"
maxWait="15000"
username="ism_cust2"
password="iamse2_"
driverClassName="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@xxx.gggg/>
 
sreekanth aleddulla
Greenhorn
Posts: 27
Spring Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
hey mark

in spring applicationContext.xml i am using like below

<bean id="UserDatabase" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:comp/env/jdbc/ISM_rep_user"></property>
<property name="lookupOnStartup" value="true"></property>
<property name="cache" value="true"></property>
<property name="proxyInterface" value="javax.sql.DataSource"></property>
</bean>

and in tomcat/conf/context.xml i am using below

<Resource name="jdbc/ISM_rep_user"
auth="Container"
type="javax.sql.DataSource"
removeAbandoned="true"
removeAbandonedTimeout="60"
logAbandoned="true"
maxActive="10"
maxIdle="5"
maxWait="15000"
username="ism_cust2"
password="iamse2_"
driverClassName="oracle.jdbc.OracleDriver" url="jdbcracle:thin:@xxx.gggg/>

and in web.xml i am using

<resource-ref>
<description>Connection Pool</description>
<res-ref-name>jdbc/ISM_rep_user</res-ref-name>
<res-type>javax.sql.Datasource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

I am still getting problem please give me some example
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic