db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <fisc...@seitenbau.net>
Subject RE: Programatically set torque.dsfactory.<MY_BASE>.connection.url
Date Thu, 28 Aug 2008 12:27:47 GMT
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 


> Hi everybody !
> I encounter a quite disturbing problem with Torque.
> I use it over Apache Derby, and I need to set a password encrypted 
> 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 
> 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 
> 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. 
> So I would like to know how to proceed to set this connection.url 
> using config files ...
> Thanks in advance everyone !
> -- 
> Pierre.
> Some people, when confronted with a problem, think "I know, I'll use 
> Now they have two problems. -- Jamie Zawinski / James Robertson

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message