Subject Re: [Firebird-Java] JNDI Resource URL again
Author Rick Fincher
Hi Andrew,

Instead of putting your context settings in a context.xml and letting the
manager move them to server.xml, put your context in server.xml yourself.

This makes deploying a two step process (put war file in webapps, put
entries in server.xml) but your context entries rarely change, so after that
you can update your webapp and redeploy as needed without messing with
server.xml.

The only problem with this is that you have to restart Tomcat after you
insert the context information because it doesn't have hot update
capability.

I don't know if XML can be made to pass the string with '&' in it unchanged,
maybe one of the XML experts on here knows how to do that.

Rick
----- Original Message -----

> Rick,
>
> Please explain some details. Where should I provide data source ? Now I
> have <resource> in context.xml and <resource-ref>
> in web.xml? Did you mean another layout? The short example would be
> great. :-)
>
> Thank you for your patience
>
> Andrew
>
> Rick Fincher wrote:
>
> >Hi Andrew,
> >
> >One possibility is to set up firebirdsql as a named data source
independent
> >of your web app and put the data source info in your WEB-INF/web.xml for
> >your app to use.
> >
> >This also has the advantage that you can move, rename, or otherwise
change
> >your database and you don't have to change your web app. You just update
> >Tomcat's server.xml file and restart the app.
> >
> >If you do it that way, you can also use the DBCP pooling mechanism to
pool
> >your connections and improve performance.
> >
> >The parameters to your data sources don't change very often but
applications
> >usually change quite frequently, so separating data sources and apps
makes
> >sense.
> >
> >Rick
> >----- Original Message -----
> >
> >
> >
> >>Hi all,
> >>
> >>As I know FB database connection parameters accepted only if specified
> >>right in resource URL. The parameters must be separated by '&'
> >>symbol. That symbol causes xml parser error and should be replaced by
> >>'&', like below:
> >>
> >> <parameter>
> >> <name>url</name>
> >>
> >>
> >>
> >>
>
><value>jdbc:firebirdsql:127.0.0.1/3050:/data/db?lc_ctype=WIN1251&sql_ro
l
> >e_name=robot</value>
> >
> >
> >> </parameter>
> >>
> >>It works fine till I want deploy my application using Tomcat manager.
> >>The deployment works fine, but when Tomcat manager inserts context of
> >>the application into server.xml, it translates '&' to '&' again.
> >>That is why Tomcat fails at next start.
> >>
> >>How to work it around? I'd like to provide parameters as a normal
> >><parameter></parameter>, but it does not work.
> >>
> >>Thanks ahead.
> >>
> >>Andrew