RE: Programatically set torque.dsfactory.<MY_BASE>.connection.url

Thomas Fischer <[email protected]>
Newsgroups gmane.comp.jakarta.turbine.torque.user
Message-ID <OFB96DABEA.D43E9827-ONC12574B3.00443209-C12574B3.004476FF@seitenbau.net>
Did you try to use the method

Torque.init(org.apache.commons.configuration.Configuration conf) 

instead of Torque.init(java.lang.String) ?

By the way: there was a big discussion about keeping the db password 
secure half a year or a year ago in the torque lists. You might be 
interested.

    Thomas

> 
> Hi everybody !
> 
> I encounter a quite disturbing problem with Torque.
> I use it over Apache Derby, and I need to set a password encrypted 
secure
> connection to my Derby base.
> So the resulting JDBC connection line is something like :
> "jdbc:derby:mybase;dataEncryption=true;bootPassword=mypass"
> Due to obvious security reason, I CAN NOT put this connection string on 
a
> config file for my app, or everybody would be able to read the pass, and
> connect to the base using other ways that my application plans to.
> So I MUST define the "torque.dsfactory.mybase.connection.url" somewhere 
else
> than in "Torque.properties".
> 
> I tried this :
> Torque.init(_torquePropertiesPath);
> Torque.getConfiguration().setProperty
> ("torque.dsfactory.mybase.connection.url",
> _secureConnectionString);
> 
> But later in my app, when I use SomeTablePeer::retrieveByPk( ... );
> Torque throws an SQLException error, pretending that "The url cannot be
> null".
> So I deduce this is because the "setProperty" doesn't set the
> torque.dsfactory.mybase.connection.url correctly ...
> If I put the connection string in Torque.properties, everything is OK. 
BUT I
> CAN NOT.
> So I would like to know how to proceed to set this connection.url 
without
> using config files ...
> 
> Thanks in advance everyone !
> 
> -- 
> Pierre.
> Some people, when confronted with a problem, think "I know, I'll use 
XML".
> Now they have two problems. -- Jamie Zawinski / James Robertson
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.