Announcement Announcement Module
Collapse
No announcement yet.
Encrypted Password for JNDI DataSource Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Encrypted Password for JNDI DataSource

    Hi,
    My application is using Hibernate, and getting the datasource through a Spring JndiObjectFactoryBean. The JNDI datasource is configured as a resource in the server.xml file of Tomcat as shown below

    <Resource name="jdbc/myapp"
    auth="Container"
    type="oracle.jdbc.pool.OracleDataSource"
    driverClassName="oracle.jdbc.driver.OracleDriver"
    factory="oracle.jdbc.pool.OracleDataSourceFactory"
    description="Oracle JDBC"
    url="jdbc:oracle:thin:@mymachine:1521:abc"
    user="testuser"
    password="passwd"
    maxActive="20"
    maxIdle="10"
    maxWait="-1"
    />

    and the entry in the applicationcontext.xml file is :
    <bean id="DataSource" class="org.springframework.jndi.JndiObjectFactoryB ean">
    <property name="jndiName">
    <value>java:comp/env/jdbc/myapp</value>
    </property>
    </bean>

    I want to use an encrypted password in the tomcat server.xml file, thereby allowing the end user to change his database without having to bother about the applicationcontext.xml file or any of my application internals.

    Could anyone please tell me how to do this ?

    I am pretty new to Spring and J2EE so in case there are any mistakes, please let me know.

    Regards,
    Sudipto Podder

  • #2
    I'm pretty sure there was a discussion of this within the last month, I'd have a search on the forum.
    Last edited by karldmoore; Aug 29th, 2007, 12:01 PM.

    Comment


    • #3
      Look at http://forum.springframework.org/sho...highlight=jndi

      Regards,

      Marcos de Sousa

      Comment

      Working...
      X