Here's one way:

In order to initialize Torque with a properties file somewhere on the
application classpath (say, "../WEB-INF/classes") in a Web application, do
this somewhere (wherever you wish to init Torque, be it in a
ContextListener, startup class, static initializer, whatever):

Class theClass = this.getClass();
ClassLoader theLoader = theClass.getClassLoader(); 
PropertiesConfiguration config = new PropertiesConfiguration();
config.load(theLoader.getResourceAsStream("Torque.properties"));
Torque.init(config);

Cheers,
David

-----Original Message-----
From: Ralf Lorenz [mailto:[EMAIL PROTECTED]] 
Sent: Monday, April 22, 2002 1:46 AM
To: [EMAIL PROTECTED]
Subject: Can't find file Torque.properties

Hi,
I recently found out about Torque and tried to get it run with Tomcat.
The Server and the MySQL-Database are running on the same machine. I build a
little test and Torque is running well outside Tomcat.
To run it with Tomcat I just put the whole lib directory and the classes
from /bin/classes under /WEB-INF/lib and /WEB-INF/classes, respectively.
I put the Torque.properties under /WEB-INF/classes and Tomcat says it can't
find it.
I'd like to know how to handle this or if there's a better way to get the
initialization properties into the application when it's supposed to run in
an Servlet-Container.

Another question is about the password() functionality within MySQL. When I
use just a normal JDBC-connection and ask for the password-attribute of a
table then I get just it and not the result of password(table.passwort). But
when I do the same with the torque-mapping then I get the latter which is
kind of not usefull for me. How can I handle this?
Thanks




--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to