setting up Tomcat Datasource information such as the response juha supplied
is correct

You always have the option of connecting straight in without looking up the
DataSource parameters
but you would have to supply all necessary parameters such as user,pass and
driver for example
        if ( c_Driver == null )
            LoadDriver();
        try {
            Properties props = new Properties();
            props.put( c_sUserNameKey, c_sDBUser );
            props.put( c_sPasswordKey, c_sDBPassword );
            return c_Driver.connect( c_sDBURL, props );
            }
        catch ( SQLException sqlex )
            {
            c_Category.error( "Error connecting to database", sqlex );
            throw sqlex;
            }

unless of course there is a disconnect on your definition of datasource?

Martin-
----- Original Message -----
From: "Roberto Pellegrino" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Wednesday, December 05, 2007 5:13 AM
Subject: Re: Tomcat data source


> I have seen the documentatio many and many times...
> My question is clear? The response to my question is:
> "Isn't possible get dataSource reference if is not defined on webApp
> context"...
> This is a limitation if application expose a method to make query in
> varius and dinamic datasource....
> Only possibilities is defined the connection with url, user, pass,
> driver....
>
> Robert.
>
> Juha Laiho wrote:
> > If you want to access a resource defined in GlobalNamingResources
> > from a webapp, the context description for the webapp must
> > contain a ResourceLink for the resource.
> >
> > ResourceLink is what you use to "map" a server resource name to
> > the resource name expected by the application (so, is something
> > that is created at time of deployment).
> >
> > Please see the documentation:
> > http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html
> > http://tomcat.apache.org/tomcat-6.0-doc/config/globalresources.html
> >
http://tomcat.apache.org/tomcat-6.0-doc/config/context.html#Resource%20Links
> >
> >
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to