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.  [ 2 posts ] 
Author Message
 Post subject: Explicit password for Oracle configuration
PostPosted: Wed Sep 12, 2007 4:06 pm 
Newbie

Joined: Tue Sep 11, 2007 2:34 pm
Posts: 5
Hi,

Is it possible to setup DB connection with Oracle without explicitly exposing DB password. I can use Connection Pool, however there is no application server, it's a standalone application.

thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 14, 2007 11:57 am 
Newbie

Joined: Tue Sep 04, 2007 2:21 pm
Posts: 14
If you use Spring you can encrypt the password in a properties file and then feed it into a datasource:

It would look something like this:

Code:
<bean id="dataSource" class="org.springframework.jdbc.datasource.SingleConnectionDataSource">
      <property name="driverClassName" value="${driverClassName}" />
      <property name="url"             value="${dbUrl}" />
      <property name="username"        value="${dbUsername}" />
      <property name="password"        ref="dbPassword" />
   </bean>
   
   <bean id="textEncrypter"
      class="net.foo.common.util.TextEncrypter">
      <constructor-arg index="0" value="DES" />
   </bean>

   <bean id="dbPassword" factory-bean="textEncrypter"
      factory-method="decrypt">
      <constructor-arg index="0" value="${dbPassword}" />
   </bean>


You could then pass the dataSource into the Hibernate factory. It might be a bit much if you don't already have Spring in the mix.

HTH
Tom


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