Well, the classes themselves wouldn't be used to get the init params or read
the db.properties file.  You would use a Servlet to do that, and then you
would just pass the params (or Connections created from those params - however
you're doing things) to the instance of the DAO class you would be using in
your application/session/request.

HTH,
-Jeff



                                                                                       
                             
                    "Christian J.                                                      
                             
                    Dechery"              To:     <[EMAIL PROTECTED]>     
                             
                    <christian@fin        cc:                                          
                             
                    ep.gov.br>            Subject:     RE: Need Ideas... big problem! 
(long)                        
                                                                                       
                             
                    07/10/02 07:27                                                     
                             
                    AM                                                                 
                             
                    Please respond                                                     
                             
                    to "Tomcat                                                         
                             
                    Users List"                                                        
                             
                                                                                       
                             
                                                                                       
                             




ok... but remember that all the classes will reside in the common\classes
dir...

So how will the class know which context accessed it? That's what I can't
figure out... I tought about config files... but I don't know inside the
dispatcher class how to identify the context... or to read the proper config
file...


.:| Christian J. Dechery
.:| FINEP - Depto. de Sistemas
.:| [EMAIL PROTECTED]
.:| (21) 2555-0332

>>> [EMAIL PROTECTED] 09/07/02 17:24 >>>

If you don't want to go the JNDI route, you could also do something like set
init params in each application's web.xml file with the db connection info or
create a .properties file for each application and read in the db connection
info from that.

HTH,
-Jeff




"Kranson, Bob"
<Bob_Kranson@comp To: "'Tomcat Users List'" < [EMAIL PROTECTED] >

uware.com> cc:
Subject: RE: Need Ideas... big problem! (long)
07/09/02 02:41 PM
Please respond to
"Tomcat Users
List"






Why don't you store the JDBC URL in JNDI and have DAO look it up
dynamically....

Bob Kranson
Software Technical Support Analyst
UNIFACE and Optimal Products Technical Support
U.S. Support Center 888-551-0404
New Calls: [EMAIL PROTECTED]
31440 Northwestern Hwy, Farmington Hills, MI 48334-2564
(248)737-7300 x12702 Fax:(248)737-7574


> -----Original Message-----
> From: Christian J. Dechery [ mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 09, 2002 2:38 PM
> To: [EMAIL PROTECTED]
> Subject: Need Ideas... big problem! (long)
>
>
> I have a huge problem here... and I can't think of a simple
> solution for it, I'm hoping u guys can give some "light". :)
>
> Let me first describe the "environment" here, then the problem.
>
> We have here a webapp called FAP (c:\tomcat\fap). It is
> composed of: /fap/*.jsp (like a hundred of them)
> /fap/WEB-INF/classes/finep (this package finep has a lot of
> subpackages) /fap/WEB-INF/classes/finep/DAO.class <-- here
> the problem resides... /fab/lib/OracleDrivers.jar
>
> the class DAO provides the Connection to an Oracle database...
>
> so far, everything is fine... but here's the thing... this
> webapp gets replicated... the whole dir, because there are
> other instances of this system with small changes, and we
> didn't have the time to create a self-configuring app to
> allow that... so we copy the whole dir and make the necessary
> changes... BUT... the classes never change... only the
> JSPs... AND another thing that may change is the database
> (and of course DAO)... so how it is done?
>
> we have /fap with DAO.class pointing to a specific db URL
> and; we have (for example) /fap2 with a few JSPs changes and
> DAO.class pointing to another URL.
>
> this of course sux! If we wanna change the database of a
> specific webapp we have to re-compile DAO and place it
> there... and if we change a class (any class) we have to
> update it in ALL the contexts...
>
> What I want:
> I would like to place the package "finep" and the
> OracleDrivers in the global context
> (c:\tomcat\common\classes, \lib), so all would be pretty and
> centralized; and create something like a Connection
> Dispatcher (also in the global context) that would receive
> requests from the JSPs and provide a Connection to the
> specific URL based in which context that JSP was when the
> request was made. I don't know if that's possible... I'm just
> guessing... of course I want do this as painless as
> possible... cuz we have like 80 classes and more than 150 JSPs...
>
> to confuse??? My english also sux... sorry!
>
>
> .:| Christian J. Dechery
> .:| FINEP - Depto. de Sistemas
> .:| [EMAIL PROTECTED]
> .:| (21) 2555-0332
>
>



The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it.


--
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]
>








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

Reply via email to