tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ariel Valentin" <asvb...@hotmail.com>
Subject Re: DataSources
Date Sun, 06 Jun 2004 01:18:58 GMT
Create an entry for the Datasource in the deployment descriptor and use JNDI 
to look it up.
Cast the object returned by the lookup method as a DataSource type.
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/Resources4.html

Mr. Ariel S. Valentin
mailto: asvb278@hotmail.com




>From: Tim Funk <funkman@joedog.org>
>Reply-To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
>To: Tomcat Users List <tomcat-user@jakarta.apache.org>
>Subject: Re: DataSources
>Date: Sat, 05 Jun 2004 17:07:57 -0400
>
>Anything is javax.servlet is container agnostic.
>
>Anything in web.xml should be container agnostic.
>
>Anything in server.xml or the context declaration (mywebapp.xml) is tomcat 
>specific.
>
>-Tim
>
>SH Solutions wrote:
>
>>Hi
>>
>>I am using a DataSource inside a a servlet. Until now I am configuring it
>>with my own code (Creating instance and using setters.)
>>What I would like to do now is, I would like to move that database
>>configuration to the web.xml file.
>>
>>So far, I have a correct fragmet for server.xml:
>>
>>     <Resource name="jdbc/dbTest" auth="Container"
>>type="org.firebirdsql.pool.FBWrappingDataSource"/>
>>
>>     <ResourceParams name="jdbc/dbTest">
>>       <parameter>
>>         <name>factory</name>
>>         <value>org.firebirdsql.pool.FBWrappingDataSource</value>    
   
>></parameter>
>>       <parameter>
>>         <name>userName</name>
>>         <value>sysdba</value>
>>       </parameter>
>>       ...
>>     </ResourceParams>
>>
>>Anyway, I would like to have it in web.xml instead.
>>Is there a way to do that? And how do I get hold of that DataSource from 
>>my
>>Java Code?
>>
>>Is this method compatible with other servlet engines?
>>I would like to prevent non-standart methods.
>>
>>
>>Regards,
>>   Steffen
>>
>>
>>BTW: Are HttpSessionListeners and ContextListeners standart or
>>tomcat-specific?
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>

_________________________________________________________________
Getting married? Find great tips, tools and the latest trends at MSN Life 
Events. http://lifeevents.msn.com/category.aspx?cid=married


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message