Note that you are using a container-managed datasource. As such, the container is required to provide the implementation details. The web.xml only really hints at the interface required. The implementation backs the interface and provides the actual code to return datasources to you. This is a GOOD thing and the absolute last thing you ever want to do is move all the information from Tomcat's proprietary server.xml into the standards-based web.xml. Keeping them separate is what makes your application portable.


When you move to a different container, the deployer will need to provide the proprietary configuration for container-managed datasources, but you will not need to make a single change to your webapp. You app is generic and uses interfaces which all containers claiming to suppport J2EE and/or the servlet spec are required to provide support for.

So, keep things as they are. You have already done the right thing.

Jake

At 04:39 PM 6/3/2003 +0200, you wrote:

is this question
1)  off topic
2)  not understandable
3) already posted in the list
4) or stupid

not to require someone's attention.
in case of
 3 : I do apologize,but I've searched the list before, in vain
 2 : I'm sorry for my poor english
 else
     keep on ignoring, I won't disturb anymore.

Meissa




[EMAIL PROTECTED] 03/06/2003 13:32 Veuillez r�pondre � "Tomcat Users List"



        Pour :  [EMAIL PROTECTED]
        cc :

Objet : DataSource configuration in web.xml instead of server.xml



hi all,

I 've configured my DataSource configuration within a DefaultContext in
the server.xml file in tomcat(4.1). Everything works fine.


Now I would like to move this configuration in the web.xml file. The


datasource section
in the documentation explains that is's possible.

I use DBCP api.

here is an extract of my server.xml datasource configuration.

<DefaultContext>


<Resource name="jdbc/raise" auth="Container" type="javax.sql.DataSource"/>



          <ResourceParams name="jdbc/raise">
 <parameter><name>username</name><value>raisepartner</value></parameter>
 <parameter><name>password</name><value>pwd4rpd</value></parameter>
            <parameter><name>driverClassName</name>
              <value>com.sybase.jdbc2.jdbc.SybDriver</value></parameter>
            <parameter><name>url</name>
 <value>jdbc:sybase:Tds:s198000WEBD:4100/raise_partner</value></parameter>




</ResourceParams>



</DefaultContext>



I guess, I must put those line below in the web.xml file




<web-app>


<resource-ref>


     <res-ref-name>jdbc/raise</res-ref-name>
     <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
  </resource-ref>

how must I specify the other parameters(username,password ...).

any help would appreciated.

Meissa






L'integrite de ce message n'etant pas assuree sur internet, Natexis Banques Populaires ne peut etre tenu responsable de son contenu. Toute utilisation ou diffusion non autorisee est interdite. Si vous n'etes pas destinataire de ce message, merci de le detruire et d'avertir l'expediteur.

The integrity of this message cannot be guaranteed
on the Internet. Natexis Banques Populaires can not therefore be
considered responsible for the contents.Any unauthorized use or

dissemination is prohibited.
If you are not the intended recipient of this message, then please delete

it and

notify the sender.



L'integrite de ce message n'etant pas assuree sur internet, Natexis
Banques Populaires ne peut etre tenu responsable de
son contenu. Toute utilisation ou diffusion non autorisee est
interdite. Si vous n'etes pas destinataire de ce message, merci de le
detruire et d'avertir l'expediteur.

The integrity of this message cannot be guaranteed
on the Internet. Natexis Banques Populaires can not therefore be
considered responsible for the contents.Any unauthorized use or dissemination is prohibited.
If you are not the intended recipient of this message, then please delete it and


notify the sender.

Reply via email to