Results 1 to 3 of 3

Thread: Encrypted Password for JNDI DataSource

  1. #1

    Default 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. #2
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,424

    Default

    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 at 12:01 PM.
    Barracuda Networks SSL VPN Lead Developer
    http://pramatr.wordpress.com
    http://twitter.com/karldmoore
    http://www.linkedin.com/in/karldmoore
    Any postings are my own opinion, and should not be attributed to my employer or clients.

  3. #3

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •