Re: Different JDBC sources?

2005-09-13 Thread Hassan Schroeder

Vsevolod (Simon) Ilyushchenko wrote:


Presumably these are two different Contexts; put the appropriate
Resource in each ${context}.xml file...



Thanks! How will different contexts be invoked depending on the URL?


Well, maybe I misunderstood the original question :-)

My presumption was that the same code exists at, say,
http://dev.example.com/   and   http://www.example.com
which are clearly different Contexts, even if they're on the same
machine being run as virtual hosts.

So each Context has a Resource addressing the appropriate DB.

Also, I need to distinguish between the test and production environment 
in the code to figure out whether emails should be sent or not. Can I 
detect the current context there?


If your setup is as described above, you could use getServerName();
alternatively, put a Parameter in the Context to turn on/off email
sending.

Apologies if this isn't relevant to your environment, though!

--
Hassan Schroeder - [EMAIL PROTECTED]
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com

  dream.  code.



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



Re: Different JDBC sources?

2005-09-13 Thread Vsevolod (Simon) Ilyushchenko



Hassan Schroeder wrote on 09/13/2005 12:33 PM:

Vsevolod (Simon) Ilyushchenko wrote:

As a relative Tomcat newbie, I can't find anything about how to use 
two different JDBC sources with the same codebase. I'd like to have 
two different URLs that use the same classes and JSP pages, but 
reference two different databases (test and production). Is there a 
standard way of achieving this?



Presumably these are two different Contexts; put the appropriate
Resource in each ${context}.xml file...


Hassan,

Thanks! How will different contexts be invoked depending on the URL?

Also, I need to distinguish between the test and production environment 
in the code to figure out whether emails should be sent or not. Can I 
detect the current context there?


Thanks,
Simon

--

Simon (Vsevolod ILyushchenko)   [EMAIL PROTECTED]
http://www.simonf.com

Terrorism is a tactic and so to declare war on terrorism
is equivalent to Roosevelt's declaring war on blitzkrieg.

Zbigniew Brzezinski, U.S. national security advisor, 1977-81

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



Re: Different JDBC sources?

2005-09-13 Thread Hassan Schroeder

Vsevolod (Simon) Ilyushchenko wrote:

As a relative Tomcat newbie, I can't find anything about how to use two 
different JDBC sources with the same codebase. I'd like to have two 
different URLs that use the same classes and JSP pages, but reference 
two different databases (test and production). Is there a standard way 
of achieving this?


Presumably these are two different Contexts; put the appropriate
Resource in each ${context}.xml file...

--
Hassan Schroeder - [EMAIL PROTECTED]
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com

  dream.  code.



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



RE: Different JDBC sources?

2005-09-13 Thread Allistair Crossley
Hi,

Yes it's called source control and build management. The "same", as you call 
it, code is the managed master code (cvs/vss etc.) and when you want that 
pushed to different servers you do so with automated build scripts like Ant, or 
deployment using application server deploy tools. 

The point is that you don't modify you code in-situ within the 
staging/production Tomcat server, you do it in the local dev envionrment, and 
when ready for deploy, it gets committed, tagged and then war'd up and deployed.

Sounds like this may just be too much for your project, but it's nevertheless 
the standard way.

Allistair.

> -Original Message-
> From: Vsevolod (Simon) Ilyushchenko [mailto:[EMAIL PROTECTED]
> Sent: 13 September 2005 17:01
> To: Tomcat Users List
> Subject: Re: Different JDBC sources?
> 
> 
> 
> 
> Allistair Crossley wrote on 09/13/2005 11:49 AM:
> > The standard way is 2 servers running their own Tomcat. 
> Each Tomcat is then configured with the datasource with 
> differing connection strings.
> 
> Allistair,
> 
> And then I would publish my code into two places? (Or alternatively I 
> can have two applications under one Tomcat, I guess.)
> 
> I was hoping to somehow avoid that and reuse one set of files 
> (I do it 
> in my Perl apps by having different front controller scripts for 
> different URLs).
> 
> Thanks,
> Simon
> -- 
> 
> Simon (Vsevolod ILyushchenko)   [EMAIL PROTECTED]
>   http://www.simonf.com
> 
> Terrorism is a tactic and so to declare war on terrorism
> is equivalent to Roosevelt's declaring war on blitzkrieg.
> 
> Zbigniew Brzezinski, U.S. national security advisor, 1977-81
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


 
---
QAS Ltd.
Registered in England: No 2582055
Registered in Australia: No 082 851 474
---
  
Disclaimer:  The information contained within this e-mail is confidential and 
may be privileged. This email is intended solely for the named recipient only; 
if you are not authorised you must not disclose, copy, distribute, or retain 
this message or any part of it. If you have received this message in error 
please contact the sender at once so that we may take the appropriate action 
and avoid troubling you further.  Any views expressed in this message are those 
of the individual sender.  QAS Limited has the right lawfully to record, 
monitor and inspect messages between its employees and any third party.  Your 
messages shall be subject to such lawful supervision as QAS Limited deems to be 
necessary in order to protect its information, its interests and its 
reputation.  

Whilst all efforts are made to safeguard Inbound and Outbound emails, QAS 
Limited cannot guarantee that attachments are virus free or compatible with 
your systems and does not accept any liability in respect of viruses or 
computer problems experienced.



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



Re: Different JDBC sources?

2005-09-13 Thread Stephen Caine

Simon,

As a relative Tomcat newbie, I can't find anything about how to use  
two different JDBC sources with the same codebase. I'd like to have  
two
different URLs that use the same classes and JSP pages, but  
reference two different databases (test and production). Is there a  
standard way of achieving this?


Shamelessly promoting our own product, you might want to take a look  
at Qilan.  An OS X application, Qilan accesses multiple JDBC database  
sources and automatically creates all the necessary JSP code.  The  
developer merely creates web pages (webtemplates), with or without  
specialized tags, then exports them to Tomcat/webapps.  If you are  
using SQL, Qilan handles this as well.  Download at:


http://cgs.qilan.com:8080/qilan/Qilanv3Beta

Stephen Caine
CommonGround Softworks, Inc.

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



Re: Different JDBC sources?

2005-09-13 Thread Vsevolod (Simon) Ilyushchenko



Allistair Crossley wrote on 09/13/2005 11:49 AM:

The standard way is 2 servers running their own Tomcat. Each Tomcat is then 
configured with the datasource with differing connection strings.


Allistair,

And then I would publish my code into two places? (Or alternatively I 
can have two applications under one Tomcat, I guess.)


I was hoping to somehow avoid that and reuse one set of files (I do it 
in my Perl apps by having different front controller scripts for 
different URLs).


Thanks,
Simon
--

Simon (Vsevolod ILyushchenko)   [EMAIL PROTECTED]
http://www.simonf.com

Terrorism is a tactic and so to declare war on terrorism
is equivalent to Roosevelt's declaring war on blitzkrieg.

Zbigniew Brzezinski, U.S. national security advisor, 1977-81

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



RE: Different JDBC sources?

2005-09-13 Thread Allistair Crossley
The standard way is 2 servers running their own Tomcat. Each Tomcat is then 
configured with the datasource with differing connection strings.

Allistair.

> -Original Message-
> From: Vsevolod (Simon) Ilyushchenko [mailto:[EMAIL PROTECTED]
> Sent: 13 September 2005 16:36
> To: Tomcat Users List
> Subject: Different JDBC sources?
> 
> 
> Hi,
> 
> As a relative Tomcat newbie, I can't find anything about how 
> to use two 
> different JDBC sources with the same codebase. I'd like to have two 
> different URLs that use the same classes and JSP pages, but reference 
> two different databases (test and production). Is there a 
> standard way 
> of achieving this?
> 
> Thanks,
> Simon
> -- 
> 
> Simon (Vsevolod ILyushchenko)   [EMAIL PROTECTED]
>   http://www.simonf.com
> 
> Terrorism is a tactic and so to declare war on terrorism
> is equivalent to Roosevelt's declaring war on blitzkrieg.
> 
> Zbigniew Brzezinski, U.S. national security advisor, 1977-81
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


 
---
QAS Ltd.
Registered in England: No 2582055
Registered in Australia: No 082 851 474
---
  
Disclaimer:  The information contained within this e-mail is confidential and 
may be privileged. This email is intended solely for the named recipient only; 
if you are not authorised you must not disclose, copy, distribute, or retain 
this message or any part of it. If you have received this message in error 
please contact the sender at once so that we may take the appropriate action 
and avoid troubling you further.  Any views expressed in this message are those 
of the individual sender.  QAS Limited has the right lawfully to record, 
monitor and inspect messages between its employees and any third party.  Your 
messages shall be subject to such lawful supervision as QAS Limited deems to be 
necessary in order to protect its information, its interests and its 
reputation.  

Whilst all efforts are made to safeguard Inbound and Outbound emails, QAS 
Limited cannot guarantee that attachments are virus free or compatible with 
your systems and does not accept any liability in respect of viruses or 
computer problems experienced.



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



Different JDBC sources?

2005-09-13 Thread Vsevolod (Simon) Ilyushchenko

Hi,

As a relative Tomcat newbie, I can't find anything about how to use two 
different JDBC sources with the same codebase. I'd like to have two 
different URLs that use the same classes and JSP pages, but reference 
two different databases (test and production). Is there a standard way 
of achieving this?


Thanks,
Simon
--

Simon (Vsevolod ILyushchenko)   [EMAIL PROTECTED]
http://www.simonf.com

Terrorism is a tactic and so to declare war on terrorism
is equivalent to Roosevelt's declaring war on blitzkrieg.

Zbigniew Brzezinski, U.S. national security advisor, 1977-81

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