Snotman,

For an example.
Search the archives for the thread "Servlets with JDBC connectivity".

Look for the messages from me.

Doug Parsons


----- Original Message ----- 
From: "Snotman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, March 05, 2004 1:08 AM
Subject: RE: DataSource not found


> Daniel,
> 
> I have not been able to get Global Resources to work. I played around 
> with them for a while, but I decided to cheat by defining my resources 
> under the <Host> element in the <DefaultContext>. Below is a stripped 
> down example. I also define a context.xml and place it under <webapp 
> root>/MEATA-INF/. This file has the <Context> definition for the webapp. 
> You can place your valve and logger info here as well as define realms 
> and put ResourceLinks I believe. This file will get copied by Tomcat to 
> <webapp root>/conf/<hostname>/. Maybe somebody can provide some good 
> example code of how to use the GlobalResources. Although, I have looked 
> at the example and for some reason I can't duplicate its success with my 
> test webapp yet.
> 
> Hope this helps,
> 
> Dan
> 
>       <Host name="localhost" debug="0" appBase="webapps" 
> unpackWARs="true" autoDeploy="true" deployOnStartup="true">
> 
>             <DefaultContext>
>                 <Resource name="jdbc/database" auth="Container" 
> type="javax.sql.DataSource" scope="Shareable"/>
> 
>                 <ResourceParams name="jdbc/database">
>                     <parameter>
>                       <name>factory</name>
>                       
> <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
>                     </parameter>
>                     <parameter>
>                      <name>username</name>
>                      <value>someusername</value>
>                     </parameter>
>                     <parameter>
>                      <name>password</name>
>                      <value>somepassword</value>
>                     </parameter>
>                     <parameter>
>                        <name>driverClassName</name>
>                        <value>org.gjt.mm.mysql.Driver</value>
>                     </parameter>
>                     <parameter>
>                       <name>url</name>
>                       
> <value>jdbc:mysql://localhost:3306/database?autoReconnect=true</value>
>                     </parameter>
>                 </ResourceParams>
>             </DefaultContext>
>       </Host>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


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

Reply via email to